Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unhiding workbook when loaded
That worked. Thank you
John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a shortcut for unhiding an Excel sheet in a workbook? | Excel Discussion (Misc queries) | |||
I am protecting my workbook, but it is broken when it is loaded by Quatro Pro, please help | Excel Discussion (Misc queries) | |||
How can i stop users inserting and unhiding rows and columns my workbook | Excel Discussion (Misc queries) | |||
Do the Addins belong to a workbook, or are they global to all workbooks loaded? | Excel Programming | |||
How to hide a loaded .xls...? | Excel Programming |