Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to hide a workbook and to detect a hidden workbook in visual basic

Hello Gurus!

I have 2 opened workbooks - deswkb & srcwkb. deswkb is the activ
workbook
1) my code to hide deswkb (i thought):
deswkb.Application.ActiveWindow.Visible = False
problem:
if i run the code again, the macro will close next activewindow whic
is srcwkb.
Question:
Is there anyway that I could code to hide deswkb and did not have thi
kind of problem?

2) I failed to detect the hidden workbook by using following codes:

If IsBookOpen("c:\excel97\Database1.xls") Then
Set deswkb = Workbooks("c:\excel97\Database1.xls")
Else
Set deswkb = Workbooks.Open("c:\excel97\Database1.xls")
End If
____when IsBookOpen is :
Function IsBookOpen(ByRef szBookName As String) As Boolean
On Error Resume Next
IsBookOpen = Not (Application.Workbooks(szBookName) Is Nothing)
End Function
question:
Is there any way that I could code to detect it succesfully?

Any suggestions would be appreciated!

Tahnks, Jeani

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

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
microsoft visual basic-compile error in hidden module:modMain Roman Piotr Excel Discussion (Misc queries) 3 January 23rd 13 01:49 PM
Visual Basic Code hidden Dennis Excel Discussion (Misc queries) 2 October 22nd 08 07:14 AM
Hide a row using Visual Basic Steve_Dallas[_2_] Excel Worksheet Functions 7 October 17th 07 03:48 PM
exel : visual basic: compile error in hidden module : Distmon cde01 Excel Discussion (Misc queries) 1 July 26th 05 01:15 PM
Saving Workbook in Visual Basic Hides the Worksheet, Why bmartin52 Excel Programming 0 January 10th 04 06:33 PM


All times are GMT +1. The time now is 07:19 PM.

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"