1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. 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...

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

Need a VBA Yoda!

Discussion in 'VBA Macros' started by sfergus9, Feb 13, 2019.

  1. sfergus9

    sfergus9 New Member

    Messages:
    5
    I’ve attached a macro-form which we are using for purchasing requisitioning. The form will allow users to fill out certain fields (red headers), convert and email as a PDF. I’ve written some code but running into some issues – as the form needs to return to a “ready state” (meaning, clearing certain fields for the next user), keep up with the requisition number counting (worksheet form_new, cell CY11), prevent users from either cut, copy, and pasting and saving it on their local drives.

    Notes:
    1. The form_new worksheet is set into "ready status" now, so the coding should return the sheet to this "look."
    2. The requisition number in cell CY11 will be saved when the user clicks commandbutton1.
    3. I want to prohibit users from dragging, cut/copy/paste to keep some order on the form.
    4. I want to prohibit users from saving the file onto their local drives.

    I have protected the worksheets with “blank passwords” if you need to reference the cells. The password to “save” the workbook is “Promat123*”.

    [Sidebar - I've been getting some runtime errors 1004 on certain users computers and do not know why - stepping through the code, I see it "breaks" here:

    Code (vb):

    With ActiveSheet
      .ExportAsFixedFormat Type:=xlTypePDF, Filename:=PdfFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
      End With
     
    I appreciate any help given!

    Attached Files:

Share This Page