• 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.

Need a VBA Yoda!

sfergus9

New Member
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:
With ActiveSheet
  .ExportAsFixedFormat Type:=xlTypePDF, Filename:=PdfFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
  End With

I appreciate any help given!
 

Attachments

  • Purchasing Requisition Form Rev. Initial (02-08-19).xlsm
    516.3 KB · Views: 5
Back
Top