Automation type not supported in Visual Basic
Hi,
I´m trying to load Excel from Visual Basic 6.0 wiht the following command:
Set objExcel = new Excel.Application
This command line generates: "Run-time error '458': Variable uses an Automation
type not supported in Visual Basic."
Does anyone have a clue how to solve this?
The client uses Office97 on win98 platform.
Regards,
Jarno
Re: Automation type not supported in Visual Basic
Jarno,
Check in Project/References and see that you have included the Microsoft
Excel library in your project.
Craig Brown
"Jarno" <jarno.nieminen@askus.se> wrote:
>
>Hi,
>
>I´m trying to load Excel from Visual Basic 6.0 wiht the following command:
>Set objExcel = new Excel.Application
>
>This command line generates: "Run-time error '458': Variable uses an Automation
>type not supported in Visual Basic."
>
>Does anyone have a clue how to solve this?
>
>The client uses Office97 on win98 platform.
>
>Regards,
>Jarno
Re: Automation type not supported in Visual Basic
I have a reference to "Microsoft Excel 8.0 Object Library".
/Jarno
"Craig Brown" <cbrown.consulting@snet.net> wrote:
>
>Jarno,
>
>Check in Project/References and see that you have included the Microsoft
>Excel library in your project.
>
>Craig Brown
>
>"Jarno" <jarno.nieminen@askus.se> wrote:
>>
>>Hi,
>>
>>I´m trying to load Excel from Visual Basic 6.0 wiht the following command:
>>Set objExcel = new Excel.Application
>>
>>This command line generates: "Run-time error '458': Variable uses an Automation
>>type not supported in Visual Basic."
>>
>>Does anyone have a clue how to solve this?
>>
>>The client uses Office97 on win98 platform.
>>
>>Regards,
>>Jarno
>
Re: Automation type not supported in Visual Basic
Hi Jarno,
This is a way I did it for an existing Workbook(can also use GetObject for
existing:
Dim excBk As excel.Workbook
Dim strPath As String
Dim excObj As excel.Application
Set excObj = CreateObject("Excel.Application")
strPath = App.Path
strFile = "WorkbookName.xls"
Screen.MousePointer = vbHourglass
With excObj
.Visible = True
.WindowState = xlMaximized
.Workbooks.Open strPath & "\" & strFile
'Set excBk = GetObject(strPath & "\[" & strFile & "]", "Excel.Sheet")
End With
Hope this helps,God bless
Van
"jarno" <jarno.nieminen@askus.se> wrote:
>
>I have a reference to "Microsoft Excel 8.0 Object Library".
>
>/Jarno
>
>"Craig Brown" <cbrown.consulting@snet.net> wrote:
>>
>>Jarno,
>>
>>Check in Project/References and see that you have included the Microsoft
>>Excel library in your project.
>>
>>Craig Brown
>>
>>"Jarno" <jarno.nieminen@askus.se> wrote:
>>>
>>>Hi,
>>>
>>>I´m trying to load Excel from Visual Basic 6.0 wiht the following command:
>>>Set objExcel = new Excel.Application
>>>
>>>This command line generates: "Run-time error '458': Variable uses an Automation
>>>type not supported in Visual Basic."
>>>
>>>Does anyone have a clue how to solve this?
>>>
>>>The client uses Office97 on win98 platform.
>>>
>>>Regards,
>>>Jarno
>>
>