I assumed you opened the workbook using automation, If the
Transferspreadsheet function opens excel as a byproduct of creating the
sheet, then I couldn't say. If you are using automation, then you should e
creating a reference to excel
oxlApp = GetObject(,"Excel.application")
set oxlBk = oxlApp.workbooks.Open("Mynewbook.xls")
and so forth.
--
Regards,
Tom Ogilvy
"JR_06062005" wrote:
> I think you are exactly right. The problem is I can't figure out how to
> create a quailfied copy. What I'm doing is creating a spreadsheet with the
> TransferSpreadsheet function and then bringing up the workbook that the
> TransferSpreadsheet function just created, making some changes and then
> closing the workbook. What I want to do after I finish the changes, is close
> the workbook and if Excel is not running, close down Excel. Problem is I can
> only close the workbook, not the program even if Excel was not previously
> running. By the way I have code to tell me whether Excel is running.
>
> As I understand the process, when I create a new workbook, if Excel was not
> already running, then it is automatically started (which is an unqualified
> reference). So how do I make a qualified reference?
>
> "Tom Ogilvy" wrote:
>
> > You are probably creating an unqualified reference to Excel. Since it is
> > unqualified, it can't be released and excel stays in memory until you hit the
> > reset button in Access or you might even have to close Access.
> >
> > always fully qualify all your references
> >
> > rather than
> > selection.Value = 3
> > xlapp.Selection.Value = 3
> >
> > where xlApp represents the reference you created when you started Excel
> > through automation.
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> > "JR_06062005" wrote:
> >
> > > Access creates a report which is exported to Excel using the
> > > TransferSpreadsheet function. My code then opens the file in Excel workbook,
> > > makes some format changes and then saves and closes the file.
> > >
> > > The workbook I created closes, but Excel, with no open workbook, remains
> > > open. I tried to close it with the code Excel.Application.Quite. But this
> > > does not close the application.
> > >
> > > How do I close the whole Excel application?
|