View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Craig McK Craig McK is offline
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