VBA veryhidden not working

Mandy79

New Member
Joined
Mar 4, 2020
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
I have a macro which opens a couple of "template" analysis files (both very similar) and a data file. It then copies the data into one of the template file in the "Sheet" worksheet. There are also a number of hidden 'calculation' worksheets and a "summary" worksheet in the template file. Essentially all the data from the "Sheet" worksheet then analysed in these hidden 'calculation' worksheets and the results get put into the "summary" worksheet to produce a graphs and text to produce an standard analysis 'report' for the data. I then repeat this for the other "template" file. As the data (now in "Sheet" is confidential), I wanted to change the "Sheet" worksheet to VeryHidden. However, the macro fails on this line (I've also tried another statement that does the same but again this fails). I've used this statement in another macro recently and it seems to work, so I cannot work out what is going. Is there any specific conditions necessary for VeryHidden to work? The worksheet is visible prior to me running the macro. I'm also sure that it worked previously! However, I've since changed PC/laptop at work and are now on a different version of Excel and maybe Windows.

I'm using Windows 10 on a 64-bit machine using Excel 2013.

This statement does not work:

Sheets("Sheet").Select
ActiveSheet.Visible = xlSheetVeryHidden

I tried this alternative but this did not work either:

Worksheets("Sheet").Visible = xlSheetVeryHidden

I've done quite a lot of searches to try to find an answer cannot find anything. So any help would be much appreciated.

Regards,

Mandy
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
VBA Code:
Sheets("Sheet").Select
Is Sheet the actual name of the sheet
Is the sheet protected in any way ?
Is the structure of the workbook protected ?
Is the sheet visible when above code is run ?
Why are you selecting the sheet ?
- that may be unnecessary
- do you (as user) need to interract with the sheet
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top