Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Workbooks.Open Filename

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!


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
GetOpen filename to open files(Workbooks) Frank Situmorang[_3_] Excel Discussion (Misc queries) 11 May 5th 09 01:02 PM
Workbooks.Open Filename:=.UpdateLinks:=0, IgnoreReadOnlyRecommended:=True [email protected] Excel Discussion (Misc queries) 5 November 9th 07 09:52 AM
Workbooks.Open Filename Konczér Tamás Excel Worksheet Functions 2 July 4th 07 04:21 PM
Trying to Open Multiple WorkBooks w/ same beginning FileName Hambone[_2_] Excel Programming 2 February 17th 04 05:36 PM
Workbooks.Open(filename) : Returning err: Object reference not... (in VB.NET) bryan Excel Programming 2 January 20th 04 07:42 PM


All times are GMT +1. The time now is 08:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"