Excel export save question

C

crossb

Hi,

I'm exporting data from Access to Excel using outputTo. This works
fine and then I open it in excel using this code:
Set xl = CreateObject("Excel.Application")
xl.Workbooks.Add strInputFileName
xl.Visible = True

which also works fine. The problem I have though is when the user
clicks save it asks them where they want to save and doesn;t just save
it to the file they already created. Is there some way I can Excel to
do this? Or should I be doing something differently?

Thanks!
 
D

David Lloyd

One suggestion would be to use the Open method rather than the Add method.
For example:

xl.Workbooks.Open strInputFileName

The Add method uses the file name as a template for a new workbook rather
than referencing the existing file name.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi,

I'm exporting data from Access to Excel using outputTo. This works
fine and then I open it in excel using this code:
Set xl = CreateObject("Excel.Application")
xl.Workbooks.Add strInputFileName
xl.Visible = True

which also works fine. The problem I have though is when the user
clicks save it asks them where they want to save and doesn;t just save
it to the file they already created. Is there some way I can Excel to
do this? Or should I be doing something differently?

Thanks!
 
Top