Addin to open and hide a workbook

A

aehan

Hello all

I am trying to make an Addin to be distributed between several users. The
Addin will open and hide a workbook with macros. in the same way as Personal
Macro Workbook. My problem is that althought the addin works, the code I
wrote hides all of the windows, not just the workbook I want to hide, and
when I reference the workbook itself I get a run time error 9. The code I
have so far is:

Sub Open_and_Hide_Macros()

Set newBook = Workbooks.Open("C:\Documents and Settings\My
Documents\Excel\Practice\MyMacros.xls")
Windows("C:\Documents and Settings\My
Documents\Excel\Practice\MyMacros.xls").Visible = False

End Sub

Can anyone help please.

Thank you
Aehan
 
A

aehan

Hello again

I solved it myself. It was a silly question I know, but I had reached the
point of hair tearing and had bogged myself down without thinking it through
properly. Apologies for asking a silly question.

Thanks
Aehan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top