Excel "UsedRange.Rows.Count" thru Inventor API

Excel "UsedRange.Rows.Count" thru Inventor API

Ktelang
Collaborator Collaborator
614 Views
1 Reply
Message 1 of 2

Excel "UsedRange.Rows.Count" thru Inventor API

Ktelang
Collaborator
Collaborator

Hello

 

The following is the part of the code which recides in Inventorobject > This Document.

I am not able to understand why the row marked red is not extracting the last used row

 

Please can any one help

 

{Code}

.

.

.

.

.

Dim MyXl As Object 'Excel Application Object
Set MyXl = CreateObject("Excel.Application")
Dim XL_File As String
Dim SheetName As String

XL_File = Workbookname
SheetName = "GLDB"

MyXl.Workbooks.Open (XL_File)

'Show the Excel *** in Excel Window.
MyXl.Application.Visible = False

On Error GoTo KillExcel:

'Get Parameters of Glass Model
Dim GLW As Parameter, GLT As Parameter, GLH As Parameter, GLType As Parameter
Set GLW = oCompdef.Parameters.UserParameters.Item("GLW")

Dim lastrow As Integer
lastrow = MyXl.Worksheets(SheetName).UsedRange.Rows.Count
Debug.Print lastrow
.

.

.

.

{Code}

 

Thanks

 

 

 

------------------------------------------------------------------------------
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
-----------------------------------------------------------------------------
0 Likes
615 Views
1 Reply
Reply (1)
Message 2 of 2

Ktelang
Collaborator
Collaborator

Never mind dumb me.. sheetname was having a typ-o

 

Man Frustrated

------------------------------------------------------------------------------
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
-----------------------------------------------------------------------------
0 Likes