Auto-Open procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to write an auto open procedure that minimizes the Excel
application and then displays the first menu form. The code I have used is:

Sub Auto_Open()

Application.WindowState = xlMinimized
fmMenuMain.Show

End Sub

This minimizes Excel but does not correctly display the form - the tab on
the taskbar flashes & has to be 'clicked' to display the form. Can anyone
help with curing this - to allow the workbook to be minimized and to display
the form correctly?

Thanks in anticipation

Patrick
 
How about hiding the application?

application.visible = false
'show your form, do your stuff

'But remember to turn it back on (sometime)
application.visible = true
 
Or maybe a modeless form?

Sub Auto_Open()
Application.WindowState = xlMinimized
fmMenuMain.Show vbModeless
End Sub

Make sure that you unload the form whenever you don't need it anymore
(Unload fmMenuMain)

With kind regards,
Ton Teuns
 
Thanks

2 possible options - great

Dave Peterson said:
How about hiding the application?

application.visible = false
'show your form, do your stuff

'But remember to turn it back on (sometime)
application.visible = true
 
I have an Auto_Open macro that is triggered via an XP Pro Schedule
Task; the macro is digitally signed and users have previously accepte
the appropriate digital certificate.

My two opening lines of code are:
Application.DisplayAlerts = False
Application.Visible = False

My objective is for users to see zero pop-up windows. As of now, thi
is the case except for a 2-second pop-up at the very beginning. (Macr
requires about 30 seconds to complete.) Is it possible to eliminate th
2-second pop-up?

TIA,
Chuckles12
 
Since you already have -
Application.DisplayAlerts = False

most pop-ups should not happen.

One of the possible sources is within code some where.
Most likely an event macro.

Look for that possible code.

Also try adding:
Application.EnableEvents=False

--
steveB

Remove "AYN" from email to respond
"Chuckles123" <[email protected]>
wrote in message
 
I tried using 'Application.EnableEvents = False' at the beginning of my
code -- there was no change in results. I have even tried this on a
very simple macro -- just a few lines of code -- same results.

I believe it is some type of 'handshaking' between: naming the macro
'Auto_Open'; using Windows' Scheduled Task as a trigger; and the user
having previously accepted and stored on his/her computer the digital
certificate. It seems there must be some way to eliminate this
2-second pop-up.

Chuckles123
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top