I need to run Excel application from VB6 application. When I run my Excel application just from Excel it works fine, but when I try to run it from VB6 application I get error message.
Here is the code of VB that runs on button's click:
I get the application started just fine, but then when I click one of the button I get an error message "Run-time error 91. Object or With block variable not set" with the statement highlited in excel:
Sheets("AdministrativeExpenses".Activate
I never got this message when I ran it from VBA Excel.
Can somebody help me here?
Here is the code of VB that runs on button's click:
Code:
Dim ExcelApp As Excel.Application
Dim ExcelWkb As Excel.Workbook
Dim ExcelSht As Excel.Worksheet
On Error Resume Next
Err.Clear
Set ExcelApp = GetObject("H:\Asset Management
Code\ExcelBudget\Budget0515.xls")
ExcelApp.Visible = True
Sheets("AdministrativeExpenses".Activate
I never got this message when I ran it from VBA Excel.
Can somebody help me here?