LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Addin to open and hide a workbook

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use AddIn to Open an addtional Excel Workbook John Cole, Jr. Excel Programming 1 August 13th 07 09:08 AM
Open and Hide a workbook MBum Excel Discussion (Misc queries) 1 July 11th 06 06:47 PM
Hide workbook instantly on open TommySzalapski[_26_] Excel Programming 5 July 29th 05 12:48 AM
Copying a sheet from an addin into an open workbook OkieViking Excel Programming 2 April 17th 05 07:39 PM
HIDE Workbook whilst VBA Form Open Steve_Dyson[_2_] Excel Programming 0 November 18th 04 10:47 AM


All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"