• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code for Macro Enable in Excel

sgmpatnaik

Active Member
Hello Sir,


Good Evening


Sir,


i need one VBA Code for Macro Enable / Call Option


i Created one work book which is totally based with Macro and VBA


That's working in my system well but when i open that workbook in other systems it's not working due to in that system the macro option is not activated when i will activate the Macro option in that system then my workbook is doing work. So i Think to create one Welcome Sheet which is help to others how to activate the Macros in their System and when the macros are activated in systems then the welcome sheet to be hide and un hide the Sheet 1 for ex. in my workbook contains 5nos. of sheets


Kindly suggest


hence i oblige


With regards


Patnaik
 
As you said, create a welcome sheet which says to enable macros. Then, hide all the other sheets. In the ThisWorkbook module, you have this code:

[pre]
Code:
Private Sub Workbook_Open()
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
ws.Visible = True
Next
Worksheets("Welcome").Visible = False
Application.ScreenUpdating = True
End Sub
[/pre]
If macros are enables, user won't even see the Welcome screen and they'll continue on their merry way. Otherwise, the Workbook_Open macro won't trigger, and they'll only see the welcome screen.
 
Thank Q Sir,


It's working Great


one small request if we want to edit the welcome sheet then how can we?


is it necessary to disable the macros


With Regards


Patnaik
 
If you want to leave the Welcome sheet visible, just modify the open macro like so:

[pre]
Code:
Private Sub Workbook_Open()
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
ws.Visible = True
Next
Application.ScreenUpdating = True
End Sub
[/pre]
 
Back
Top