Excel "UsedRange.Rows.Count" thru Inventor API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
-----------------------------------------------------------------------------