ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Workbooks.Open Filename (https://www.excelbanter.com/excel-worksheet-functions/148899-workbooks-open-filename.html)

Konczér Tamás

Workbooks.Open Filename
 
'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!

Bob Phillips

Workbooks.Open Filename
 
See response in .programming

--
---
HTH

Bob

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



"Konczér Tamás" wrote in message
. ..
'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!



Konczér Tamás

Workbooks.Open Filename
 
Thank you Bob.

"Bob Phillips" az alábbiakat írta a következő hírüzenetben: ...
See response in .programming

--
---
HTH

Bob

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



"Konczér Tamás" wrote in message
. ..
'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!




All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com