I would appreciate your help. I'm using VB6 with Access 2002 on Win 2k
I want to automatically export a report from Access 2002 as an excel file. Iwant to call the VB exe from the Task Scheduler. When I run the Visual Basic 6 code is says
Runtime error '3011'
The Microsoft Jet Database engine could not find the Object "Inventory_rpt_HCPG" in the database.
The database is opening and I do see the specified report, but for some reason VB can not see the report in the access db.
I would really appreciate your help. Thank you in advance for your time.
============
Private Sub Form_Load()
Dim objAccess As Object
Dim strrptname
strrptname = "Inventory_rpt_HCPG"
acformatXLS = "Microsoft Excel 97-2002 (*.xls)"
Set objAccess = CreateObject("Access.Application"
objAccess.Visible = False
objAccess.OpenCurrentDatabase ("I:\
'Export access report to Excel .xls format
objAccess.docmd.OutputTo acOutputReport, strrptname, acformatXLS, "c:\Inetpub\ False
objAccess.quit acexit
End Sub
============
I want to automatically export a report from Access 2002 as an excel file. Iwant to call the VB exe from the Task Scheduler. When I run the Visual Basic 6 code is says
Runtime error '3011'
The Microsoft Jet Database engine could not find the Object "Inventory_rpt_HCPG" in the database.
The database is opening and I do see the specified report, but for some reason VB can not see the report in the access db.
I would really appreciate your help. Thank you in advance for your time.
============
Private Sub Form_Load()
Dim objAccess As Object
Dim strrptname
strrptname = "Inventory_rpt_HCPG"
acformatXLS = "Microsoft Excel 97-2002 (*.xls)"
Set objAccess = CreateObject("Access.Application"
objAccess.Visible = False
objAccess.OpenCurrentDatabase ("I:\
'Export access report to Excel .xls format
objAccess.docmd.OutputTo acOutputReport, strrptname, acformatXLS, "c:\Inetpub\ False
objAccess.quit acexit
End Sub
============