Hi,
I am new to vba and trying to code to select range in the excel file but getting type mismatch error for ' set myRange = Range("C:C") '. Can anyone help to fix this error.
'select Excel File
FPath = CATIA.FileSelectionBox("C:\Users\pughade\Desktop\DMU folder\PRIME\New folder", _
"*.xlsx", CatFileSelectionModeOpen)
If FPath = "" Then
Exit Sub
End If
Set xlApp = CreateObject("Excel.Application")
Set MyXL = GetObject(, "Excel.Application")
Set MyXL = GetObject(FPath)
MyXL.Application.Visible = True
MyXL.Parent.Windows(1).Visible = True
Set myRange = Range("C:C")
PILC = MyXL.Application.WorksheetFunction.CountA(myRange)
MsgBox ("Part Inst List Count=" & PILC)
I am new to vba and trying to code to select range in the excel file but getting type mismatch error for ' set myRange = Range("C:C") '. Can anyone help to fix this error.
'select Excel File
FPath = CATIA.FileSelectionBox("C:\Users\pughade\Desktop\DMU folder\PRIME\New folder", _
"*.xlsx", CatFileSelectionModeOpen)
If FPath = "" Then
Exit Sub
End If
Set xlApp = CreateObject("Excel.Application")
Set MyXL = GetObject(, "Excel.Application")
Set MyXL = GetObject(FPath)
MyXL.Application.Visible = True
MyXL.Parent.Windows(1).Visible = True
Set myRange = Range("C:C")
PILC = MyXL.Application.WorksheetFunction.CountA(myRange)
MsgBox ("Part Inst List Count=" & PILC)