hi guys
I made Macro at VBA of Excel that convert the Excel Sheet to PDF and send it via Outlook mail
know i try to save the file on google drive or firebase, my project that i build all ready use firebase as database ,the same project also open the excel file as invoice and the user send the invoice form excel after it convert to pdf
this is the code of the macro,i like to add to this code the code that upload the pdf to google drive of firebase
ub Email_From_Excel_Basic()
Dim emailApplication As Object
Dim emailItem As Object
Dim strPath As String
Excel.ActiveWorkbook.WebOptions.Encoding = msoEncodingHebrew
' Build the PDF file name
strPath = ActiveWorkbook.Path & Application.PathSeparator & "Sheet1.pdf"
' Export workbook as PDF
Worksheets("Invoice Template").ExportAsFixedFormat xlTypePDF, strPath
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
' Now we build the email.
emailItem.To = ""
emailItem.CC = ""
emailItem.Subject = ""
emailItem.HTMLBody = ""
' Attach the PDF file
emailItem.Attachments.Add strPath
' Send the Email
' Use this OR .Display, but not both together.
emailItem.Send
MsgBox "Email send"
' Display the Email so the user can change it as desired before sending it
' Use this OR .Send, but not both together.
'emailItem.Display
Set emailItem = Nothing
Set emailApplication = Nothing
' Delete the PDF file
Kill strPath
Workbooks("Invoice Template.xlsm").Close SaveChanges:=False
ActiveWorksheet.Close SaveChanges:=False
ActiveWorkbook.Close SaveChanges:=False
For Each w In Application.Workbooks
Next w
Application.Quit
End Sub
Bookmarks