Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Darla Morrison   on Aug 19 In MS Office Category.

  
Question Answered By: Evelyn Hughes   on Aug 19

You are on the right "path". You just need to include the full path
of the file  like "C:\dir1\file.xls" when you open it. Something like
this is useful if the files are in the same directory as the macro's
workbook:

p = Application.ThisWorkbook.Path
Workbooks.OpenText Filename:=p & "\" & file1 & ".xls"

You may want to use the FileDialog Object. Search excel help  or
yahoo for more info.

After that, change the following:
Workbooks(file1).Activate
Workbooks(file1 & ".xls").Activate

Share: 

 
 
Didn't find what you were looking for? Find more on Activate a worksheet or workbook with a variable name Or get search suggestion and latest updates.


Tagged: