excel issue - ilogic workaround to load list?

excel issue - ilogic workaround to load list?

andrew_canfield
Collaborator Collaborator
336 Views
1 Reply
Message 1 of 2

excel issue - ilogic workaround to load list?

andrew_canfield
Collaborator
Collaborator

office.JPG

 

Hello

 

I've code to read a list of file paths from excel (to save as pdf's) but something has happened to excel (will hopefully fix soon) - but whilst the excel error appears on opening I 've realised it's opening & closing for every call.

 

Is an alternative to copy & paste the list of file paths into inventor parameter or something similar so only one call needs to be made?

Still trying to understand array's - find it difficult to see the contents in iLogic.

 

Regards

 

Andrew

0 Likes
337 Views
1 Reply
Reply (1)
Message 2 of 2

Ralf_Krieg
Advisor
Advisor

Hello

 

Is it possible that only the standard application for file type xls and/or xlsx has changed from Excel to OneNote. What happens if you double click your excel file in windows explorer? Does it open in Excel?

 

 

It is possible to read a range of cells in an two dimensional array with

 

Dim oWs as Excel.WorkSheet
Dim oRng As Excel.Range = oWS.Range("A1:A10")
Dim MyArray As Object(,) = CType(oRNG.Value, Object(,))

 

The array is 1-based and the first dimension is rows, the second columns. If you read only cells from 1 column (as shown in example code), the second dimension is always 1. So you can traverse the array by

 

Dim sPath As String
Dim i As Integer
For i=1 to UBound(MyArray, 1)
    sPath=MyArray(i, 1)
    '...your code to open document and save as PDF
Next

 

 

Code not tested, but hopefully correct.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes