Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default how to set workbook window active

I have an add in that i have installed with all my macros in it. In one of my
macros i call it to open another workbook for a vlookup. i then want to
continue with the previous workbook but i dont know how to return the focus
to that workbook.

add in: macros.xla
file opened: opened.xls (name is variable!)
call to open: master list.xls

I cant do Thisworkbook.active because i am running out of the add-in.
i cant do windows(opened.xls).active because i wont know the file name.

What can i do? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default how to set workbook window active

On Nov 26, 1:21 pm, Daniel M
wrote:
I have an add in that i have installed with all my macros in it. In one of my
macros i call it to open another workbook for a vlookup. i then want to
continue with the previous workbook but i dont know how to return the focus
to that workbook.

add in: macros.xla
file opened: opened.xls (name is variable!)
call to open: master list.xls

I cant do Thisworkbook.active because i am running out of the add-in.
i cant do windows(opened.xls).active because i wont know the file name.

What can i do? Thanks.


you could store the recent workbook before opening the opened.xls
and then restore it again:
'----------------------------------------------------------
dim Curr_WB as workbook

set Curr_WB = activeworkbook

'openworkbook
'do your thing

Curr_WB.activate
'----------------------------------------------------------
hth

Carlo
Reply
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 open a workbook per active window Jackie[_2_] Excel Discussion (Misc queries) 1 August 19th 08 11:13 PM
How to Active Window maperalia Excel Programming 5 July 13th 07 03:56 PM
keystroke to close active workbook window Vickie Excel Worksheet Functions 4 December 7th 05 11:21 PM
I can't adjust the window size of an active workbook. Julie Excel Discussion (Misc queries) 1 January 26th 05 05:19 PM
active window Gerry Excel Programming 2 December 17th 04 03:33 PM


All times are GMT +1. The time now is 01:19 PM.

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

About Us

"It's about Microsoft Excel"