Hide workbook/worksheets Excel VBA
<p>I have a simple Microsoft Excel spreadsheet with a few tabs. On opening the workbook I have a USER LOGIN form that loads up and asks for login and password. What I'm trying to do is somehow not let the user see the sheets in the workbook until they've successfully logged in. The problem I'm seeing is that one of my sheets has a macro in it, so what I do</p>

<pre><code>sheet1.visible=xlhidden
</code></pre>

<p>it gives me a debug error. However, even if I skipped that sheet and hid all the other ones - and on proper login I tried to make them Visible=xlVisible, they still did not become visible. How would I go about something like that?</p>

<p>Is there some kind of a way to be able to hide the workbook possibly and then make it visible after successful login?</p>