View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Subscript out of range error

What is the error?? Is should be "Drink Plan.xls"

Workbooks("Drink Plan.xls").Activate
Workbooks("Drink Plan.xls").Worksheets("Price Groups").Visible = True


If this post helps click Yes
---------------
Jacob Skaria


"Ken Warthen" wrote:


Jacob,

Thanks for the help. I changed the Workbooks reference to the following.

Workbooks("Drink Plan").Worksheets("Price Groups").Visible = True

The code continues to fail.

Ken

"Jacob Skaria" wrote:

Try the below. Specify the workbook..in between the quotes


Workbooks("<workbookname").Sheets("Price Plan").Visible = True

--
If this post helps click Yes
---------------
Jacob Skaria


"Ken Warthen" wrote:

I have an Excel 2003 format spreadsheet with quite a bit of VBA code to
validate user entries, create reports, and as code behind several userforms.
I've got everything working fine, except it the user has a second spreadsheet
open in which case my login userform fails with an error 9, subscript out of
range error message on the following line.

Workbooks(1).Worksheet("Price Plan").Visible=True

Any idea on why my code is failing, and how it can be fixed?

TIA,

Ken