Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forcing users to enable macros

Hello all,

To acheive this Ive employed the "hidden (useful) worksheet becomes
visible if macros are enabled" method.

A second sheet is visible, that tells users that they must enable
macros on loading the file. Should they already have macros enabled,
the first thing that is run is to hide this sheet.

Unfortunately, when loading the excel file, it shows the other sheet
for a split second. Is there any way to stop this happening?

Code he

Private Sub Workbook_Open()

Application.ScreenUpdating = False

Call enablemacros

Call openformat

Application.ScreenUpdating = True

etc.........


Then in a module:

Sub enablemacros()

Worksheets("UsefulWorksheet").Visible = True
Worksheets("RemindToEnableMacros").Visible = False

End Sub



Many thanks,
Ed


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Forcing users to enable macros

Ed,

Just a reminder.
Are you insuring that you hide the "Useful" sheet(s) in the Before_Save
Event.

As for your question....
When you open the file, that "RemindToEnable" sheet is going to be the first
thing
that appears on the screen. Normally, it would cycle fast enough that you
should
hardly see it at all. The problem is that your Application.ScreenUpdating is
freezing the display until your code finishes (leaving that sheet visible
until your
code completes).
Try it without the Application.ScreenUpdating = False

John


"universal" wrote in message
...
Hello all,

To acheive this Ive employed the "hidden (useful) worksheet becomes
visible if macros are enabled" method.

A second sheet is visible, that tells users that they must enable
macros on loading the file. Should they already have macros enabled,
the first thing that is run is to hide this sheet.

Unfortunately, when loading the excel file, it shows the other sheet
for a split second. Is there any way to stop this happening?

Code he

Private Sub Workbook_Open()

Application.ScreenUpdating = False

Call enablemacros

Call openformat

Application.ScreenUpdating = True

etc.........


Then in a module:

Sub enablemacros()

Worksheets("UsefulWorksheet").Visible = True
Worksheets("RemindToEnableMacros").Visible = False

End Sub



Many thanks,
Ed


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forcing users to enable macros

Thanks for the reply John,

And thanks for the reminder, I am rehiding the sheet on Close.

Ive tried without the ScreenUpdating now. Unfortunately it doesnt see
to make too much difference. There is still a little delay. It i
perhaps my own fault though since the file is now over 1Mb due to th
amount of code.

Im thinking perhaps if no-one can think of a way round the problem,
might try to make the best of a bad situation and have the front pag
appear that it is in fact loading macros. It could say "Please wait
macros being enabled" and pause for a second then run the hidin
macro.

Any other ideas

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Forcing users to enable macros

Ed,

Any other ideas?

Sure......

Create a UserForm to use as a Splash Screen.
Make it cover whatever you need to on that "reminder" sheet.
Call your code from within the UserForm Activate Event.
e.g.

'In the workbook module
Private Sub Workbook_Open()
UserForm1.Show
End Sub

' In the UserForm1 module
Private Sub UserForm_Activate()
DoEvents
enablemacros
openformat
Unload UserForm1
End Sub

When the user opens the file, the UserForm should come
right up and stay there until all your code completes.

John



"universal" wrote in message
...
Thanks for the reply John,

And thanks for the reminder, I am rehiding the sheet on Close.

Ive tried without the ScreenUpdating now. Unfortunately it doesnt seem
to make too much difference. There is still a little delay. It is
perhaps my own fault though since the file is now over 1Mb due to the
amount of code.

Im thinking perhaps if no-one can think of a way round the problem, I
might try to make the best of a bad situation and have the front page
appear that it is in fact loading macros. It could say "Please wait,
macros being enabled" and pause for a second then run the hiding
macro.

Any other ideas?


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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forcing users to enable macros

Again, many thanks.

The userform is shown over the top of the "ReminderWorksheet", thoug
the reminder is still visible for a split second underneath, before th
userform loads.

Ummm..........

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Forcing users to enable macros

Ed,

Again.....if when you save the workbook, the only visible sheet
is your "reminder" sheet, that sheet will appear on the screen
whenever the workbook is opened.
When your Worksheet_Open code runs, it'll hide that sheet
but until it does so, it'll still be visible.
What I was suggesting was using the UserForm as a splash screen
to physically hide whatever "reminder" dialog that you have on that sheet
until your code (embedded in that UserForm), actually does hide the sheet.

Another option that you might want to experiment with is
Application.Visible.
Setting it to false will hide the entire workbook (not the UserForm). You
can set it back to true just before you close the UserForm.

John

"universal" wrote in message
...
Again, many thanks.

The userform is shown over the top of the "ReminderWorksheet", though
the reminder is still visible for a split second underneath, before the
userform loads.

Ummm...........


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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Forcing users to enable macros

Ed,

Adding to what I just wrote......
With macros enabled, the UserForm should "cover" the "Reminder" sheet.
If macros aren't enabled, the UserForm won't show and they'll be left
with nothing but your "reminder" sheet visible.

John

"John Wilson" wrote in message
...
Ed,

Again.....if when you save the workbook, the only visible sheet
is your "reminder" sheet, that sheet will appear on the screen
whenever the workbook is opened.
When your Worksheet_Open code runs, it'll hide that sheet
but until it does so, it'll still be visible.
What I was suggesting was using the UserForm as a splash screen
to physically hide whatever "reminder" dialog that you have on that sheet
until your code (embedded in that UserForm), actually does hide the sheet.

Another option that you might want to experiment with is
Application.Visible.
Setting it to false will hide the entire workbook (not the UserForm). You
can set it back to true just before you close the UserForm.

John

"universal" wrote in message
...
Again, many thanks.

The userform is shown over the top of the "ReminderWorksheet", though
the reminder is still visible for a split second underneath, before the
userform loads.

Ummm...........


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





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forcing users to enable macros

Ive now tried application.visible = false as the first command in
workbook_open. Still the reminder flashes up for (allbeit) probably a
tenth of a second.

Is there any way I can add a delay in somewhere to give Excel chance to
run more lines before displaying anything at all?


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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Forcing users to enable macros

Ed,

As the workbook is saved with that one worksheet visible, I really
don't think that there's a way to not have it display before your
code starts running.

John

"universal" wrote in message
...
Ive now tried application.visible = false as the first command in
workbook_open. Still the reminder flashes up for (allbeit) probably a
tenth of a second.

Is there any way I can add a delay in somewhere to give Excel chance to
run more lines before displaying anything at all?


---
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
Force users to enable macros when open a workbook Tan New Users to Excel 2 April 15th 07 05:09 PM
Forcing users to enter value based on criteria Adi Excel Discussion (Misc queries) 2 January 6th 07 12:17 PM
Forcing users to update spreadsheets DKerr Excel Discussion (Misc queries) 2 July 27th 06 12:55 PM
Forcing users to complete a form BK Excel Discussion (Misc queries) 3 November 22nd 05 12:35 AM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


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