Workbooks.Open Filename

  • Thread starter Thread starter =?ISO-8859-1?Q?Koncz=E9r_Tam=E1s?=
  • Start date Start date
?

=?ISO-8859-1?Q?Koncz=E9r_Tam=E1s?=

'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!
 
See response in .programming

--
---
HTH

Bob

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



'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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top