Hello forum guys.
I want to know what is the way of referencing worksheet within the GetObject function.
I know there are other ways of refering.
On the MSDN documentation there is example of referencing the class and object with the syntax like this.
so i supposed it to use it like this
Workbook opens up but there is an error message saying automation error. Invalid syntax.
Can anyone help me with proper syntax to reference worksheet,objects etc ?
I cant find proper syntax for it.
Thanks in advance
I want to know what is the way of referencing worksheet within the GetObject function.
I know there are other ways of refering.
On the MSDN documentation there is example of referencing the class and object with the syntax like this.
Code:
[COLOR=#0101FD][FONT=Consolas]Set[/FONT][/COLOR][COLOR=#000000][FONT=Consolas] LayerObject = GetObject([/FONT][/COLOR][COLOR=#A31515][FONT=Consolas]"C:\CAD\SCHEMA.CAD[B]!Layer3[/B]"[/FONT][/COLOR][COLOR=#000000][FONT=Consolas])[/FONT][/COLOR]
so i supposed it to use it like this
Code:
Dim otherwb As Object
Set otherwb = New Excel.Application
Set otherwb = GetObject("C:\myfile.xlsm[B]!Sheet1[/B]")
Workbook opens up but there is an error message saying automation error. Invalid syntax.
Can anyone help me with proper syntax to reference worksheet,objects etc ?
I cant find proper syntax for it.
Thanks in advance