![]() |
Hide, not close, one workbook
I have three workbooks open. I'd like to set an object to one of them so I
can hide it away from the user, but still have it available for VBA to write to it. As far as I can tell, I have to use Application.Window, but I can't figure out how to set an object to one particular window to manipulate it. Hints and suggestions are greatly appreciated. Ed |
Hide, not close, one workbook
Wiindows(WorkbookName).Visible = False
WorkbookName should be the name as it appears in the title bar (normally the file name) "Ed" wrote: I have three workbooks open. I'd like to set an object to one of them so I can hide it away from the user, but still have it available for VBA to write to it. As far as I can tell, I have to use Application.Window, but I can't figure out how to set an object to one particular window to manipulate it. Hints and suggestions are greatly appreciated. Ed |
Hide, not close, one workbook
Hi Ed,
Something like windows("Book2").Visible=False -- HTH Bob Phillips "Ed" wrote in message ... I have three workbooks open. I'd like to set an object to one of them so I can hide it away from the user, but still have it available for VBA to write to it. As far as I can tell, I have to use Application.Window, but I can't figure out how to set an object to one particular window to manipulate it. Hints and suggestions are greatly appreciated. Ed |
Hide, not close, one workbook
' at the top of a module
Public bk as workbook Sub HideBook() set bk = Workbooks("MyFile.xls") Windows(bk.name).Visible = False End Sub Sub UpdateBk() bk.worksheets("Sheet1").Range("A1").Value = 12 End Sub Sub SeeDatafromBook() msgbox bk.Worksheets("Sheet1").Range("A1").Text End Sub -- Regards, Tom Ogilvy "Ed" wrote in message ... I have three workbooks open. I'd like to set an object to one of them so I can hide it away from the user, but still have it available for VBA to write to it. As far as I can tell, I have to use Application.Window, but I can't figure out how to set an object to one particular window to manipulate it. Hints and suggestions are greatly appreciated. Ed |
Thank you!
Thanks to both of you.
"Ed" wrote in message ... I have three workbooks open. I'd like to set an object to one of them so I can hide it away from the user, but still have it available for VBA to write to it. As far as I can tell, I have to use Application.Window, but I can't figure out how to set an object to one particular window to manipulate it. Hints and suggestions are greatly appreciated. Ed |
Hide, not close, one workbook
The suggestions from the others will work...for the most part. A more
robust approach is the code fragment below. It is from an add-in I wrote recently for a fried: For i = 2 To MasterWB.Windows.Count MasterWB.Windows(i).Close Next i MasterWB.Windows(1).Visible = False -- Regards, Tushar Mehta www.tushar-mehta.com Multi-disciplinary business expertise + Technology skills = Optimal solution to your business problem Recipient Microsoft MVP award 2000-2005 In article , says... I have three workbooks open. I'd like to set an object to one of them so I can hide it away from the user, but still have it available for VBA to write to it. As far as I can tell, I have to use Application.Window, but I can't figure out how to set an object to one particular window to manipulate it. Hints and suggestions are greatly appreciated. Ed |
All times are GMT +1. The time now is 07:56 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com