quesnelljc
Technical User
I am trying to write some code into a data access page which will export data from an access database.
I am gettinging the error "ActiveX component cannot create object Access.Application" when running the following code:
Dim objAcc
Set objAcc = CreateObject("Access.Application")
objAcc.Visible = False
path = " from home\test db connection.mdb"
objAcc.OpenCurrentDatabase path
objAcc.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "table1", " from home\output.xls", True
objAcc.Quit
Set objAcc = Nothing
msgbox "Done"
I have tried running the same piece of code within an access database and it all works as expected so I can't understand why the problem occurs in a data access page.
Any help or support would be much appreciated.
I am gettinging the error "ActiveX component cannot create object Access.Application" when running the following code:
Dim objAcc
Set objAcc = CreateObject("Access.Application")
objAcc.Visible = False
path = " from home\test db connection.mdb"
objAcc.OpenCurrentDatabase path
objAcc.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "table1", " from home\output.xls", True
objAcc.Quit
Set objAcc = Nothing
msgbox "Done"
I have tried running the same piece of code within an access database and it all works as expected so I can't understand why the problem occurs in a data access page.
Any help or support would be much appreciated.