Authorising Purchase Orders

lizemi

New Member
Joined
Sep 5, 2021
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hi I have an Excel sheet that generates Purchase orders.
I also have a macro that emails and saves the PO to the relevant person and saves it on our company's one drive.
I am looking for suggestions on how the manager can electronically approve (sign) the po.
Fill and sing using adobe does seem to take to long and any person in the company can copy the managers signature as picture and use it.
I was thinking of issuing the manager a pin code that he can authorise th po with ( so if he enters the pin it authorizes the po)
How can I include that in my VBA

My curent VBA is
Sub Send_Email()
Dim wPath As String, wFile As String

wPath = "https://our company's sharepoint adress /"
wFile = Range("d3").Value & ".pdf"

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPath & wFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False


Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = Range("b39")
dam.Subject = Range("d3")
dam.Body = wPath & wFile
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"


End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
VBA Code:
Sub Send_Email()
Dim wPath As String, wFile As String

wPath = "[URL='https://our/']https://our[/URL] company's sharepoint adress /"
wFile = Range("d3").Value & ".pdf"

if InputBox("Enter Provided Pin #") = 1234 'change 1234 to your preferred pin
then

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPath & wFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False


Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = Range("b39")
dam.Subject = Range("d3")
dam.Body = wPath & wFile
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"
else
MsgBox("The Pin you have provided is invalid, please try again")
end if
exit sub


End Sub

This is untested, but I think will get you where you want to be.
 
Upvote 0
VBA Code:
Sub Send_Email()
Dim wPath As String, wFile As String

wPath = "[URL='https://our/']https://our[/URL] company's sharepoint adress /"
wFile = Range("d3").Value & ".pdf"

if InputBox("Enter Provided Pin #") = 1234 'change 1234 to your preferred pin
then

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPath & wFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False


Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = Range("b39")
dam.Subject = Range("d3")
dam.Body = wPath & wFile
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"
else
MsgBox("The Pin you have provided is invalid, please try again")
end if
exit sub


End Sub

This is untested, but I think will get you where you want to be.
Hi thanks. I tested the code, it does work however our process is that the send email macro is performend by the person requesting the po ( the byer) he receives the po in pdf form aftrer performing the send email macro, I was looking for something that will allow the manager o open the pdf with a pin and it inserts a signature on th epdf file and saves to our directory
 
Last edited:
Upvote 0
Hi thanks. I tested the code, it does work however our process is that the send email macro is performend by the person requesting the po ( the byer) he receives the po in pdf form aftrer performing the send email macro, I was looking for something that will allow the manager o open the pdf with a pin and it inserts a signature on th epdf file and saves to our directory
Or if possible I can change my send mail macro to email the manager the po in excel not in pdf - and that sheet that is emailed has a macro that if the manager enters his pin it will add his signature as a picture in a specific cell and then save if as pdf in our company SharePoint
 
Upvote 0
ub Sign()
'
' Sign Macro
' Sign
Range("d37").Select 'Select cell where the signature is going.
attachFile = Application.GetOpenFilename(FileFilter:="Picture Files (*.jpg;*.bmp;*.png), *.jpg;*.bmp;*.png", Title:="Select Signature File") 'Prompt to upload the signature file.
If attachFile = False Then Exit Sub 'If no file uploaded exit the subroutine.
Set signimage = ActiveSheet.Pictures.Insert(attachFile) 'Attach image
With signimage
'Resize Picture to fit in the range....
.Left = Range("d37").Left + (Range("d37:d37").WIDTH - .WIDTH) / 0.5 'centre image
.Top = Range("d37").Top + (Range("d37:d37").HEIGHT - .HEIGHT) / 0.5 'centre image
.Placement = 1
.PrintObject = True
End With

End Sub


I found this code that allows a picture to be inserted , could this be modfied to work,

What I want to tell the macro is if
pin code 1234 is entered insert picture A( routing to picture saved on our sharepoint ( This will be managers a pin code and a picture of manager A signature)
pincode 2345 is entered insert picture B( routing to picture saved on our sharepoint ( This will be managers B pin code and a picture of manager B signature)
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top