Activating a workbook help

  • Thread starter Thread starter bmwmcrider
  • Start date Start date
B

bmwmcrider

Hello,

I am attempting to develop a utility that has several workbooks in it.
In an unrelated workbook worksheet I have a command button that
launches a userform containing a MultiPage control. The first tab on
the control presents the user with several option buttons; each button
is associated with a workbook in the utility. The remaining tabs in
the MultiPage control perform various operations on the selected
workbook.

When I select an option button to activate a selected workbook and
apply that selection I get a error - runtime error 9: subscript out of
range. The code I am using to activate a typical workbook in the
group is as follows:

Workbooks("<full path name>Cash Transactions.xls").Activate

My question is how do I programmatically activate a workbook for
subsequent data entry from a userform? Is the above code correct?
Can you even activate workbooks using the technique I described above?

TIA ...

Mike
 
The argument to the workbooks collection is the workbook name without the
path.

Workbooks("Myfile.xls").Activate

as an example.
 
Back
Top