View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Workbooks.Open Filename

Set oOldWB = Workbooks("Gazszamla_adatok.xls").

tfileKimutatas = Application.GetOpenFilename("Adatok (*.xls),*.xls") If
fileKimutatas < False Then

'I open it, if the string not empty:

Set oNewWB = Workbooks.Open(Filename:=fileKimutatas)

'Operations:

....

'I am going back to the original file:

oOldWB.Activate

'Operations:
....


'I use the opened file:
With oNewWB

' do something

End With



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Konczér Tamás" wrote in message
. ..
Dear all,

'I ask for a new filename:

fileKimutatas = Application.GetOpenFilename("Adatok (*.xls),
*.xls") If fileKimutatas < False Then

'I open it, if the string not empty:

Workbooks.Open Filename:=fileKimutatas

'Operations:

....

'I am going back to the original file:

Workbooks("Gazszamla_adatok.xls").Activate

'Operations:
....


'I activate the opened file:
Workbooks(2).Activate

....
....

End if

My question is:

Instead of Workbooks(2).Activate how could I link to that file?
(The "fileKimutatas" variable has the name of the file)

Thank you in advance!