Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Open but not activate

Hi

Is it possible to open a workbook, but not activate it

My problem is that I need to open a workbook to get data from (MASTER), but
I then need to open (SLAVE) again to get the criteria from, but (SLAVE) has
not been saved at this point. I tried to save the (SLAVE), but with no luck
as follows


' fname is the (SLAVE) workbook

fname = Application.GetSaveAsFilename
ActiveWorkbook.SaveAs Filename:=fname
Workbooks.Open "MASTER"
Workbooks(fname).Activate

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Open but not activate

I think the problem is that you are trying to activate by path and name, not
just name

Try

' fname is the (SLAVE) workbook

fname = Application.GetSaveAsFilename
ActiveWorkbook.SaveAs Filename:=fname
fShortName = ACtiveworkbook.Name
Workbooks.Open "MASTER"
Workbooks(fShortName).Activate


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Craig McK" wrote in message
...
Hi

Is it possible to open a workbook, but not activate it

My problem is that I need to open a workbook to get data from (MASTER),

but
I then need to open (SLAVE) again to get the criteria from, but (SLAVE)

has
not been saved at this point. I tried to save the (SLAVE), but with no

luck
as follows


' fname is the (SLAVE) workbook

fname = Application.GetSaveAsFilename
ActiveWorkbook.SaveAs Filename:=fname
Workbooks.Open "MASTER"
Workbooks(fname).Activate

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Open but not activate

Thanks bob
Would have been there for a while trying to work that one out

Craig

"Bob Phillips" wrote:

I think the problem is that you are trying to activate by path and name, not
just name

Try

' fname is the (SLAVE) workbook

fname = Application.GetSaveAsFilename
ActiveWorkbook.SaveAs Filename:=fname
fShortName = ACtiveworkbook.Name
Workbooks.Open "MASTER"
Workbooks(fShortName).Activate


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Craig McK" wrote in message
...
Hi

Is it possible to open a workbook, but not activate it

My problem is that I need to open a workbook to get data from (MASTER),

but
I then need to open (SLAVE) again to get the criteria from, but (SLAVE)

has
not been saved at this point. I tried to save the (SLAVE), but with no

luck
as follows


' fname is the (SLAVE) workbook

fname = Application.GetSaveAsFilename
ActiveWorkbook.SaveAs Filename:=fname
Workbooks.Open "MASTER"
Workbooks(fname).Activate

Thanks




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
can't seem to activate an open workbook dantee Excel Discussion (Misc queries) 1 July 11th 08 02:48 AM
how to Activate the previous Open, workbook..? acegap Excel Programming 3 June 25th 06 04:14 PM
How to auto activate macro when file open ? bonzio Excel Worksheet Functions 1 December 16th 05 02:45 PM
open and activate workbook? Dave Peterson[_3_] Excel Programming 0 June 30th 04 03:07 AM
Excel VBA - Activate Open Workbooks to format exceller Excel Programming 2 June 10th 04 12:14 PM


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