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: 61
Default bring focus to workbook with variable name

my program runs from a userform and uses one workbook. there is a link
on the userform, however, that can open another workbook. if this
other workbook is opened, the userform will interact with that workbook
since it is the active one. I need the original workbook to be
activated before manipulating the form again. I was able to solve this
using the following code in every section that referred to the original
workbook:

Dim WB1 As Workbook
Set WB1 = Workbooks("<filename.xls")
WB1.Activate

I then realized that I have a save as button on the userform and the
workbook will often be saved with a different name rendering the above
code useless, or worse. is there a way around this? thanks.

 
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
Bring focus to same cell every time opened?? Rita Brasher Excel Discussion (Misc queries) 2 July 18th 08 05:57 PM
Bring one sheet from one workbook to another via formula Fgbdrum Excel Discussion (Misc queries) 1 November 28th 06 09:18 PM
Double Clicking on link w/i workbook does't bring me to souce. tfranc Excel Worksheet Functions 2 July 19th 06 01:16 PM
Run macro when excel workbook gains focus NickHK Excel Programming 4 March 31st 06 12:39 PM
Public variable is reset after addin macro completes - thread/focus pblm? hscowan Excel Programming 1 February 19th 04 09:07 PM


All times are GMT +1. The time now is 02:16 AM.

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"