LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel: A document with the name is already open

This simple Excel automation from Access (both '97) is giving me
problems:

1. I do an OutputTo or a TransferSpreadsheet.
2. I use Automation to carry out one manipulation with Excel
3. I save the workbook and close the workbook and quit Excel.

However, when I run Excel and open the workbook directly, I am still
getting the "Document already open" dialog. I can't see Excel in
TaskManager Apps or Processors before I launch Excel manually.

Any help appreciated.

Ananda


============ Code below: ================


DoCmd.OutputTo ObjectType:=acTable, _
objectname:=kstrTempTablename, _
outputformat:="MicrosoftExcel(*.xls)", _
Outputfile:=strFQN, _
Autostart:=False

If fIsAppRunning("Excel") Then
Set objXL = GetObject(, "Excel.Application")
boolXLwasThere = True
Else
Set objXL = CreateObject("Excel.Application")
boolXLwasThere = False
End If

objXL.Workbooks.Open strFQN

Set objWBK = objXL.Workbooks(1)

objWBK.Worksheets(1).Cells.EntireColumn.AutoFit

objWBK.Save

objWBK.Close SaveChanges:=False

Set objWBK = Nothing

If Not boolXLwasThere Then
objXL.Quit
End If

Set objXL = Nothing

====== End Code ===============

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel document doesn't open after using it all day CAS Excel Discussion (Misc queries) 2 February 21st 09 02:02 PM
I forgot my password to open an excel document, how do I open it? chris ohearn Excel Discussion (Misc queries) 1 August 11th 08 02:32 PM
my excel document won't open unless i go file, then open EB500 Excel Discussion (Misc queries) 1 June 3rd 05 06:42 PM
why must I open an Excel document twice to get it to open after . NottaBoy Excel Discussion (Misc queries) 1 May 17th 05 09:22 AM
When I open excel document it always ask if I want to open it in . dperkins Excel Discussion (Misc queries) 0 February 15th 05 08:11 PM


All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"