OutputTo method with temporary file

qwertyjjj

Registered User.
Local time
Yesterday, 19:23
Joined
Aug 8, 2006
Messages
262
I have used the DoCmd.OutputTo method successfully when I have specified a filename for the data.

This time round I need to actually output the data to a temporary file so that the user can export data as many times as they want and it won't overwrite the data in the existing file (i.e. a new instance of Excel is opened each time).

I have the following code:

'Start a new workbook in Excel
Dim oApp As New Excel.Application
Dim oBook As Excel.workBook
Dim oSheet As Excel.workSheet

Set oBook = oApp.Workbooks.Add
Set oSheet = oBook.Worksheets(1)

Is there a way to build in the DoCmd.OutputTo method here or does it always have to be a permanent file?
 

Users who are viewing this thread

Back
Top Bottom