Opening another workbook while current one is open
Bob,
If this macro is in the rates.xls workbook then it will be the
activeworkbook on completion.
Try it again with this version and when the macro stops hover over x to get
the active workbook name.
Sub sistance_level_wages()
Set myworkbook = ActiveWorkbook
Workbooks.Open ("c:\Documents and settings\myname\my documents\taxes.xls")
myworkbook.Activate
x = ActiveWorkbook.Name
Stop
End Sub
Mike
"Bob" wrote:
Mike,
Thanks for the help! Unfortunately, at the completion of your macro, the
"Taxes.xls" workbook is the active one rather than the "Rates.xls" workbook.
Bob
"Mike H" wrote:
Maybe:-
Sub sistance_level_wages()
Set myworkbook = ActiveWorkbook
Workbooks.Open ("c:\Documents and settings\myname\my documents\taxes.xls")
myworkbook.Activate
End Sub
Mike
"Bob" wrote:
After I have opened an existing workbook (Rates.xls"), I need to run a macro
(stored in the "Rates.xls" workbook) that will open another workbook called
"Taxes.xls" that's located in the "My Documents" folder. After "Taxes.xls"
has opened, I then need to make "Rates.xls" the active workbook so I can
continue to run the macro.
Can someone tell me how to do this, and make it so that the macro will work
on anyone's computer (the workbooks will always be located in a user's "My
Documents" folder.
Any help would be greatly appreciated. Thanks.
Bob
|