LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Application.visible........


Private Sub Workbook_Open()
Application.OnWindow = ThisWorkbook.Name & "!ThisWbkOnly"
Application.DisplayAlerts = False
Application.IgnoreRemoteRequests = True
Application.DisplayAlerts = True
Application.Visible = False
Application.EnableCancelKey = xlDisabled
Sheets("sheet2").Visible = True
Sheets("sheet1").Visible = xlVeryHidden
Userform1.Show vbmodless
End Sub

Sub ThisWbkOnly()
If Not ActiveWorkbook.Name = ThisWorkbook.Name Then
ActiveWorkbook.Close False
MsgBox "Excel private instance !", 64
End If
End Sub

I think this covers most of it, but there is some code within a class
module called from the form which sets it modeless too, its from
formfun which I have tried to learn and adapt but I am still struggling
to understand it...

Duncan




Duncan wrote:

Bob,

I will post back tomorrow as I have to shoot off now, that is if you
have time to look back tomorrow?

I will say though there is an awful lot of code to post to show what it
is doing here and there, really I have utilised a lot from other coders
and made the form modeless and suchlike which makes the
application.visible = false setting very very needed, I will explain
tomorrow.

Many thanks

Duncan


Bob Phillips wrote:

Show me your code, and I will see what I can do.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Duncan" wrote in message
ups.com...
Bob,

I have tried just placing this in my workbook_open above the rest of my
code but it didnt work.

Am I applying it wrong? as to be honest I didnt know how to tie it in
with what I have...

(it broke on "If Windows(wb.Name).Visible Then" when I had another
workbook open first)

Duncan

Bob Phillips wrote:

Count the visible workbooks, if greater than 1 hide the workbook, else

hide
the application

Function VisibleBooks() As Long
Dim wb As Workbook
Dim cWBs As Long

For Each wb In Application.Workbooks
If Windows(wb.Name).Visible Then
cWBs = cWBs + 1
End If
Next wb

VisibleBooks = cWBs

End Function


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Duncan" wrote in message
oups.com...
Hi all,

I am sure this can be done, its just a case of how!

When I open my file it hides the application so I can work only with
the form, everything is working fine and I have spent ages making it,
only to realise that if other worksheets are open before opening this
file - it hides them with the app.

now this scenario could be avoided if the users opened this file first
before any other excel files because after this one is open everything
else opens in its own instance.

But what I would love to be able to do is leave their other instance
open when mine is opened, so that nothing is hidden away from them

that
they already have open.

I thought maybe I could see if others are open, then create a new
instance, tie their sheets to it and then hide my instance. I just

dont
have a clue how to do this (or even if it can be done)

If anyone can think of a solution to this I would be most gratefull.

Many thanks in advance

Duncan



 
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
Application.Visible = False SimonB Setting up and Configuration of Excel 1 October 16th 06 09:51 PM
Application.Visible = False SimonB Excel Discussion (Misc queries) 1 October 15th 06 01:10 PM
Application Visible Frank Excel Programming 6 December 20th 05 08:01 PM
Visible Instances of an Application TCook Excel Programming 4 October 9th 05 05:11 AM
Application.visible help Glen Mettler[_4_] Excel Programming 0 February 16th 05 10:04 PM


All times are GMT +1. The time now is 01:49 AM.

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"