Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default 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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default 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



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
Hide Close Button Excel 2007 [email protected] Excel Discussion (Misc queries) 0 May 31st 07 07:52 AM
Hide worksheets before close [email protected] New Users to Excel 2 April 26th 06 07:25 PM
close (hide) toolbars Anthony Excel Discussion (Misc queries) 7 June 5th 05 03:19 PM
hide detail / close group outline Bettergains Excel Programming 0 February 18th 05 08:37 PM
Hide minimise, maximise, and close buttons on form Gordon Garnsey Excel Programming 3 March 1st 04 02:41 PM


All times are GMT +1. The time now is 03:53 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"