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: 7
Default opening or activating another workbook file

Happy New Year to everyone!

I'm trying to create a procedure that does the following:

1. opens a workbook named "myFile.xls" and makes that newly opened workbook
the active workbook.
2. if that workbook is already open but is not the active workbook, then it
makes myFile.xls the active workbook.

I'd like to accomplish this without causing the user to click through alerts
or message boxes when the procedure runs.

In this application, myFile.xls always exists in the current directory, so
there's no need to use the dir command to change directories, or to specify
the directory path. Under these circumstances, I know you can open the file
using

Workbooks.Open Filename:="myFile.xls"

and if I knew it was already open, you could activate it using

Windows("myFile.xls").Activate

But how do I handle it if I don't know whether the file is alerady open, and
I need to make it the active workbook?

Thank you in advance.



 
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
How to avoid opening an empty workbook every time I open a file? Nick Papadakis Setting up and Configuration of Excel 2 February 12th 06 11:55 AM
Activating "Todays Date" column upon opening? Jeremy H via OfficeKB.com Excel Discussion (Misc queries) 3 August 25th 05 02:36 AM
Open workbook without activating it Kelley[_2_] Excel Programming 3 October 29th 03 04:49 PM
Activating workbook with variable Name Mark Klaus Excel Programming 2 October 24th 03 10:41 PM
Activating a workbook help bmwmcrider Excel Programming 1 October 21st 03 01:48 PM


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