Send PDF file to a webhook with VBA

nd0911

Board Regular
Joined
Jan 1, 2014
Messages
166
I have a Make (Integromat) webhook and I want to send a PDF file via Excel VBA.
The PDF file is on my desktop path.

This is the code I have:

VBA Code:
 Public Sub SendPDF()
 Dim URL As String
 Dim Req As Object
 Dim PdfFullPath As String
   
   
 Set Req = CreateObject("WinHttp.WinHttpRequest.5.1")
   
 On Error GoTo Er
   
   
 PdfFullPath = "C:\Users\MyUserName\Desktop\MyPDF.pdf"
   
 URL = "https://hook.make.com/xxxxxx?"
   
   
   
 Req.Open "POST", URL, False
 Req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
 Req.Send
   
   
 MsgBox Req.ResponseText
   
 Exit Sub
   
 Er:
 End Sub

Is it possible to send a PDF to webhook with VBA ?

Thank you
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,215,214
Messages
6,123,660
Members
449,114
Latest member
aides

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