View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
aehan aehan is offline
external usenet poster
 
Posts: 17
Default Addin to open and hide a workbook

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


"aehan" wrote:

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