Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Unhiding workbook when loaded

In Microsoft Word, using VB, I write to an Excel workbook. When I go to Excel and load the workbook, all sheets are hiden (I have to manually unhide the whole workbook). I have been trying to find a way to unhide the workbook, either before saving from Word or when it is opened in Excel

Here is the sequence
1. Load a Document in Word - on opening the document, my VB runs displaying a userform. When the "Save" command button on the userform is clicked, the Word document is saved (using a different name)

2. Still in the "Save" command button function, I then save the data to an Excel spreadsheet (across an intranet connection) using the following code to access it

Set WorkBook = GetObject("S:\TWI FORMS\data-Intro to Job Skills.xls"
Set myWorkSheet = WorkBook.Sheets("by date"

After writing in the data, I close the workbook using the following code

WorkBook.Sav
Set myWorkSheet = Nothin
Set WorkBook = Nothin

3. After closing Word, I open Excel and load the Workbook. I get the "Enable Macros" screen and click "Yes," but there is no indication that the workbook has even been loaded -- the whole WorkBook is hidden. You have to unhide it before you can get to the VB editor

I have put a popups (MsgBox) as the first line of functions to show that it was being run (since breakpoints cannot be saved) such as App_WorkbookOpen (and other subs meant to run on opening a workbook), but they never show. Also, Workbook.Worksheet.Visible = True does not work from Word (compile error)

I think the above subs are not being accessed because the workbook is still hidden

Thanks. This has been driving me crazy

John





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unhiding workbook when loaded

I have only worked with hiding and unhiding worksheets but this seems t
work.

You must have a subroutine called

Code
-------------------

sub Workbook_Open()

-------------------

This will run whenever the workbook is opened. You then need a line o
code to actually unhide the workbook. This seems to work:

Code
-------------------

Windows("YourWorkbookName.xls").Visible = True

-------------------


--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Unhiding workbook when loaded

That worked. Thank you

John
Reply
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
Is there a shortcut for unhiding an Excel sheet in a workbook? Colleen Excel Discussion (Misc queries) 2 October 19th 07 11:01 PM
I am protecting my workbook, but it is broken when it is loaded by Quatro Pro, please help SAM SEBAIHI Excel Discussion (Misc queries) 4 February 5th 07 11:08 PM
How can i stop users inserting and unhiding rows and columns my workbook G20EGG Excel Discussion (Misc queries) 0 September 14th 06 10:32 PM
Do the Addins belong to a workbook, or are they global to all workbooks loaded? Chip Pearson Excel Programming 3 August 6th 03 11:01 PM
How to hide a loaded .xls...? faustino Dina Excel Programming 1 August 2nd 03 02:52 AM


All times are GMT +1. The time now is 09:54 PM.

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

About Us

"It's about Microsoft Excel"