Visible property on Worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everyone

Does anyone know how you can change the default "xlsheetvisible" setting for Worksheet.visible through VBA, bearing in mind that I have tryed all of the bellow conitations of code:

Application.Workbooks(BOOK1).Worksheets(Sheet1).Visible = xlsheetveryhidden

With Workbooks(BOOK1).Worksheets(Sheet1
.visible = xlveryhidde
end wit

I have also tryed several ways of defining the worksheet

Can anyone help out

Thanks
 
Russell,

If you want to use text strings, you need to enclose in quotes, such as

Application.Workbooks("BOOK1").Worksheets("Sheet1").Visible =
xlsheetveryhidden


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Russell Lucas said:
Hello everyone,

Does anyone know how you can change the default "xlsheetvisible" setting
for Worksheet.visible through VBA, bearing in mind that I have tryed all of
the bellow conitations of code:-
 
Hi Russel
try
Worksheets("Sheet1").Visible = xlsheetveryhidden

works for me
Frank
 
Bob,

Thanks for your reply. The example I gave was taken from a book where I am using constance rather thana string.

The arguments are correct, but there is application or object error not allow it. What I'm looking for is a work around to stop, what appears to be some form of built in protection.

Thanks

----- Bob Phillips wrote: -----

Russell,

If you want to use text strings, you need to enclose in quotes, such as

Application.Workbooks("BOOK1").Worksheets("Sheet1").Visible =
xlsheetveryhidden


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Russell Lucas said:
Hello everyone,
for Worksheet.visible through VBA, bearing in mind that I have tryed all of
the bellow conitations of code:-
 
does the workbook only have one worksheet? at least one worksheet must
remain visible.

What is the error message you get?

--
Regards,
Tom Ogilvy

Russell Lucas said:
Bob,

Thanks for your reply. The example I gave was taken from a book where I am
using constance rather thana string.
The arguments are correct, but there is application or object error not
allow it. What I'm looking for is a work around to stop, what appears to be
some form of built in protection.
 
Tom

The error message I recieve is a 1004 Application defined or object defined error, rather none descript. I wasn't aware you need one visible sheet in a book, this maybe my problem. I will test it an add another posting if it is unsuccessful

Thanks
 
Back
Top