LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reverting to open workbook in excel

You have to figure out whether the workbook is open already or not and only
call the open method if it isn't already open - there is no such option.

On Error Resume Next
set wkbk = Workbooks("myfile.xls")
On Error goto 0
if wkbk is nothing then
set wkbk = Workbooks.Open( "C:\My Documents\myfile.xls")
Else
wkbk.Activate
End if


--
Regards,
Tom Ogilvy

"Daniel Wright" wrote in message
...
Hello,


In the word object model there is a property of the open method which
allows you to revert to the file if it is already open.

I can't find a similar property in the open method of the excel object
model; does anybody know if this is possible so that excel will revert
to the open workbook if it has already been opened.

Thanks

Daniel.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



 
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
Auto save in excel 2000 keeps reverting to 10 minutes JT Spitz Excel Discussion (Misc queries) 4 February 9th 10 04:21 PM
Opening Excel, Book1 opens, remains open with other workbook open DanieB Excel Discussion (Misc queries) 0 September 3rd 09 08:23 AM
REVERTING A EXCEL FILE TO ITS PREVIOUS SAVE Trav Excel Discussion (Misc queries) 4 January 3rd 07 11:47 PM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
Excel workbook does not open in open window on desktop DeanH Excel Discussion (Misc queries) 2 March 8th 05 09:51 AM


All times are GMT +1. The time now is 06:17 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"