MultiValue.list - message box one value at a time

MultiValue.list - message box one value at a time

andrew_canfield
Collaborator Collaborator
335 Views
1 Reply
Message 1 of 2

MultiValue.list - message box one value at a time

andrew_canfield
Collaborator
Collaborator

Hello 

I have code to export to pdf, dwg using a loop through excel (after exporting a list of filepaths to excel) - this opens excel everytime .

My guess is it's slicker to read the files paths from a list, I can input the list of filepaths but struggling to extract a path at a time.. 

multivalue.jpg

 

Regards

 

Andrew

0 Likes
Accepted solutions (1)
336 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor
Accepted solution

Yes you have just put the excel list into an array list now you can either loop through the list and do something one by one or use a list box to allow the user to select manually. You could also eliminate excel by working directly with the filepaths and putting these into an array list in code so that would speed up processing unless your using excel for other reasons. 

Option 1:Place excel list into a multi value parameter then loop through this list

MultiValue.List(“d0”) = GoExcel.CellValues(xlPath, “Sheet1”, “D2”, “D10”)
Dim PathList As New ArrayList()
PathList = MultiValue.List(“d0)
Dim oPath as String

’loop through array list 
For Each oPath in PathList ‘use the string from arraylist Next  

Option 2: Work directly with excel list and place into an array list then  loop through this list. List exists entirely in the code. 

Dim PathList As New ArrayList()
PathList = GoExcel.CellValues(xlPath, “Sheet1”, “D2”, “D10”)
Dim oPath as String

’loop through array list 
For Each oPath in PathList
‘use the string from arraylist
Next  

 

Option 3:User interaction using a list box.

 

Dim PathList As New ArrayList() PathList = GoExcel.CellValues(xlPath, “Sheet1”, “D2”, “D10”)

Dim oPath as String
oPath = InputListBox("Prompt", PathList, "", Title:= "Select a path ", ListName := "PathList")
MsgBox(oPath) 

 

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan