R
RonaldoOneNil
I am writing data from my access database into an Excel spreadsheet.
In the code snippets below can anyone tell me why the following happens ?
1. When the routine has finished, why is Excel still in my process list if I
look using Ctrl-ALT-Del - Task manager ? If I exit access it has gone from
the process list.
2. Sometimes, but not always, it breaks on the sheets.Add line with either
of the following messages Error 462 remote server is not available or Error
1002 Add method of sheets _Global failed ??
Public xlExcel as Excel.Application
Public xlBook as Excel.Workbook
..
..
Dim xlServSheet as Excel.Worksheet
Set xlExcel = CreateObject("Excel.Application")
Set xlBook = xlExcel.Workbooks.Open("C:\temp\test.xls")
..
..
Set xlServSheet = xlBook.Sheets.Add(After:=Worksheets(Worksheets.Count))
..
..
xlExcel.Quit
Set xlServSheet = Nothing
Set xlBook = Nothing
Set xlExcel = Nothing
In the code snippets below can anyone tell me why the following happens ?
1. When the routine has finished, why is Excel still in my process list if I
look using Ctrl-ALT-Del - Task manager ? If I exit access it has gone from
the process list.
2. Sometimes, but not always, it breaks on the sheets.Add line with either
of the following messages Error 462 remote server is not available or Error
1002 Add method of sheets _Global failed ??
Public xlExcel as Excel.Application
Public xlBook as Excel.Workbook
..
..
Dim xlServSheet as Excel.Worksheet
Set xlExcel = CreateObject("Excel.Application")
Set xlBook = xlExcel.Workbooks.Open("C:\temp\test.xls")
..
..
Set xlServSheet = xlBook.Sheets.Add(After:=Worksheets(Worksheets.Count))
..
..
xlExcel.Quit
Set xlServSheet = Nothing
Set xlBook = Nothing
Set xlExcel = Nothing