+ Reply to Thread
Results 1 to 10 of 10

Macro to cancel Startup Messages

  1. #1
    Registered User
    Join Date
    06-20-2007
    Location
    Australia
    Posts
    3

    Macro to cancel Startup Messages

    I have a Macro that opens numerous excel files.

    What code do I require to cancel the startup message?

    ie. The message that displays "Disable / Enable Macros" (security setting cannot be changed, so message is always displayed).

    Plus I then have some startup message boxes which I manually click OK to continue, but how do I cancel this messages using VBA Code?

    Anyone able to assist?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This is a security warning and it is against the Forum rules to ask for code to suppress it, or to answer such questions.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-29-2007
    Posts
    5
    I have just started to frequent this forum, and this is my first post. Still, royUK's reply seems unnecessarily blunt and unhelpfull. This sort of question must be one of the most frequently asked by budding VBA programmers and I'm surprises how little information I found when I searched the forums for an answer.

    IanBrown,

    If the security settings in Excel are set to High, I don't know if there is a way to run your code without the warning or without a digital certificate. I think digital certificates can be purchased, but this is not usually an option for hobbyists or smaller VBA projects. However, I think if the security settings are set to Medium or Low, you can create your own Digital Signature using a utility which comes with your Office CD called "selfcert.exe". You may or may not have installed it already, search for "selfcert.exe" on your computer. Do a Google Search or search your Excel help file for "Digital signature" for more information.

    Basically, the selfcert.exe program allows you to create your own certificate to digitall sign your VBA projects. The first time a user opens an excel file that contains your code and your signature, there is a way (Open file -> View Certificate -> Install Certificate -> Reopen file) to install the certificate. Once installed, the security warning will no longer be displayed when he opens documents containing the code that you have signed. It's important that you sign all of your projects with the same certificate so that users don't have to repeatedly install different certificates.

    Good luck!

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi Murple

    If you want to complain about the rules, then direct them to VBA Noob who dreamt up the rules and posted them as a registered user set up especially (and only) for this purpose (X-Cell, who'll you see has only 5 posts to his credit). Anyone feel free to send him a PM complaining abut the rules. You'll probably find most mods don't agree with them either (two notwithstanding).

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Registered User
    Join Date
    06-29-2007
    Posts
    5
    Wtf!? I just spent a considerable amount of time composing a concise and helpfull reply. A very legitimate reply to a very legitimate question. Was it sensored and removed from the forum?

    Please also clarify what you mean by
    If you want to complain about the rules, then direct them to VBA Noob who dreamt up the rules and posted them as a registered user set up especially (and only) for this purpose (X-Cell, who'll you see has only 5 posts to his credit). Anyone feel free to send him a PM complaining abut the rules. You'll probably find most mods don't agree with them either (two notwithstanding).
    VBA Noob dreamt up the rules? Who is VBA Noob? Who is X-cell and what does he have to do with this? Are you one of the moderators that agrees with the rules?

    I will check the rules when I have time, but right now, I cannot fathom why a post explaining how to facilitate the distribution and use of VBA projects should be removed. Without circumventing this warning by using the utility that is provided by Microsoft (which I will not name for fear of being sensored again), the resulting VBA projects are so much more annoying, and that entierly defies their purpose.

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi Murple

    VBA Noob is a moderator who invented a series of rules for everyone to obey without bothering to check if anyone else agreed with them. For reasons best known to himself he set a new user up (X-Cell) for the sole purpose of posting the rules. Therefore everyone is expected to obey a set of rules laid down by a registered user - not a moderator or (as should be) administrator, whose only contribution to the board is a set of rules.

    I, for the record, believe there should be 3 rules :
    Be polite.
    Don't cross post.
    Don't span across forums.

    DominicB

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I answer 100s of questions - what do you want a novel? hardly surprisng that you didn't find the answer searching the forums because all the major Excel Forums do not permit this sort of code to be published.

    I also think that even self certified projects generate a warning, you can buy a certification but it costs $$$
    Last edited by royUK; 06-29-2007 at 06:57 AM.

  8. #8
    Registered User
    Join Date
    06-29-2007
    Posts
    5

    Red face

    dominicb,
    Thank you for your reply. I understand what you meant now and I agree with you. Also, I thought that you had removed my previous post from the forum, but now I can see that it is there. I'm not sure if you removed and put it back or if you never touched it and I'm just the real Noob around here. Regardless, it's all good now.

    royUK,
    Glad to hear you answer 100s of questions. I don't expect a novel, I just felt your reply was too short to be of any value to anyone. I was under the impression that IanBrown was a relatively new coder and hadn't heard of selfcert.exe. I had the exact same experience as he did, when I started making VBA projects and I wouldn't have bothered to make any of them had I not discovered selfcert.exe.

    The set-up we have is that everyone's settings are on Medium and everyone has accepted my certificate. This means that I can create new VBA code or edit old code, and the users will not be bothered by any annoying warnings at all. They open the excel file and the code runs without problem. I just put my security level to High and the code still run without warnings. Excel XP version.

    IanBrown should have received all the answers he needs by now.

    Take care everyone and happy coding.

    P.S. Can't make up my mind about all the smiley icons around this reply-box. No I can, there are way too many for this type of forum.

  9. #9
    Registered User
    Join Date
    06-20-2007
    Location
    Australia
    Posts
    3

    Smile Automatically cancelling MsgBox messages

    Many thanks for your assistance thus far.

    Perhaps a simpler problem is that I also have numerous MsgBox messages displayed when I open my excel file (ie. located in Workbook_open).

    These messages are useful to the individual users, but when I create a macro to open, say 50, of these excel files (to collate all the data) I need to click "OK" continually!

    Is there a command to automatically cancel these message boxes?

    Regards.....

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You could test if the main workbook is open, if it isn't run the message.

    You would need this Function, place it in a Standard module, in each workbook that has the messagebox.

    Please Login or Register  to view this content.
    Then in the Workbook_Open event

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1