MnMoondog
03-20-2003, 09:05 AM
I have some VB 6.0 code that looks through an Access 97 database and exports various records to an Excel 97 spreadsheet. The code I use for opening the Excel is as follows:
Set xlApp = New Excel.Application
'---
'Open Excel
'---
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Add
Set xlsSheet = xlApp.ActiveWorkbook.Sheets(1)
xlApp.Visible = False
When I run the code from the server (logged into the server) the code works great. However, when I schedule the task to run at night the code breaks at the Set xlApp = New Excel.Application line.
I set the security on the Scheduled task to run as the same user that works when I am logged into the system.
I'm at a loss...Please help.
Set xlApp = New Excel.Application
'---
'Open Excel
'---
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Add
Set xlsSheet = xlApp.ActiveWorkbook.Sheets(1)
xlApp.Visible = False
When I run the code from the server (logged into the server) the code works great. However, when I schedule the task to run at night the code breaks at the Set xlApp = New Excel.Application line.
I set the security on the Scheduled task to run as the same user that works when I am logged into the system.
I'm at a loss...Please help.