+ Reply to Thread
Results 1 to 7 of 7

Lock Macro Print Settings

  1. #1
    Registered User
    Join Date
    07-03-2019
    Location
    Orlando, Florida
    MS-Off Ver
    2013
    Posts
    19

    Lock Macro Print Settings

    Hello!

    This might be pretty simple but I have reached the end of my googling abilities and didn't see another thread related to this problem. I created print macro for my team but each time someone changes a setting inside the workbook, it screws all of the print settings up for the macro. I understand that before BeforePrint option will help lock this in place but I continue to get a Expected End Sub error that I cant seem to get rid of. Thank you for your help. The code is below from VBA.


    Please Login or Register  to view this content.

    If that's not right please let me know.
    Last edited by shawnsdad; 08-10-2019 at 09:17 PM.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Lock Macro Print Settings

    Hello shawnsdad,

    If you follow the Forum Rules, only then will I be allowed to offer some assistance.

    Administrative Note:


    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

    Regards
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    07-03-2019
    Location
    Orlando, Florida
    MS-Off Ver
    2013
    Posts
    19

    Re: Lock Macro Print Settings

    I made an update. Not sure if it right.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Lock Macro Print Settings

    Hello shawnsdad,

    If you follow the instructions in the Post, the Code you want to Post should look like this:

    Please Login or Register  to view this content.
    So go back to your Post and, Click on Edit Post, then Highlight the code and click on the # Icon. Then Submit your post again.

  5. #5
    Registered User
    Join Date
    07-03-2019
    Location
    Orlando, Florida
    MS-Off Ver
    2013
    Posts
    19

    Re: Lock Macro Print Settings

    I think I got it now. Thank you.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Lock Macro Print Settings

    Hello shawnsdad,

    Thank you!

    Please try the Code below in place of what you have. (Replace the Code in Total for that procedure)

    Please Login or Register  to view this content.
    Paste the Code in the ThisWorkbook-event Code, without the first line of your original Code - "Sub ThisWorkbook()"

    HTH

  7. #7
    Registered User
    Join Date
    07-03-2019
    Location
    Orlando, Florida
    MS-Off Ver
    2013
    Posts
    19

    Re: Lock Macro Print Settings

    Thanks. That's where I was able to get to before but it won't link to an existing macro or allow me to create and link it to one. Any thoughts?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to change print settings
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2019, 05:46 AM
  2. [SOLVED] Macro Print Settings
    By DKsmash2014 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-08-2016, 06:11 AM
  3. Macro to print pdf with certain print settings
    By ChrisLN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2016, 07:44 AM
  4. macro to copy all print settings to all sheets
    By rbanks in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2016, 11:13 AM
  5. Controlling print settings using Excel macro
    By DGillham in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-21-2012, 08:34 AM
  6. [SOLVED] Macro to Set Worksheet to Specific Print Settings
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2011, 10:59 AM
  7. Specific print settings in macro
    By Rodeoclown in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2010, 07:26 PM

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