I currently have my invoice setup to simplify how i save my file as, which specific folder, then the option to send it as an email.
the minor issue i have is the pdf code. its saves to the correct business name folder but it also saves to the general invoice folder
for example
business name folder
\Invoice\business\Invoice 379 business.pdf
General Invoice Folder
\Invoice\379 business.pdf
how do i prevent it from saving to the general invoice folder and keep the same functions
Code
Sub EmailAspdf()
Dim EApp As Object
Set EApp = CreateObject("Outlook.application")
Dim Eitem As Object
path = "C:\Google Drive\Business Office Work\Accounting\Invoices\"
invno = Range("F5")
invna = Range("B3")
address = Range("B22")
custname = Range("B13")
fname = invna & " " & invno & " - " & custname
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
IgnorePrintAreas:=False, _
filename:=path & fname
Set Eitem = EApp.CreateItem(0)
With Eitem
.To = Range("B16")
.Subject = " " & address & " - " & invna & " " & invno
.Body = "Please Find Invoice Attached. If Paying By E-Transfer, Please Add Invoice Number or Address In the comment section of the E-Transfer!"
.Attachments.Add (path & fname & ".pdf")
.Display
End With
End Sub
Sub SaveAspdf()
Dim invno As Long
Dim invna As String
Dim address As String
Dim custname As String
Dim path As String
Dim fname As String
Dim wb2 As Workbook
Dim ws2 As Worksheet
Set wb2 = ThisWorkbook
Set ws2 = wb2.Worksheets("Business Contacts")
path = ws2.Range("F2")
invno = Range("F5")
invna = Range("B3")
address = Range("B22")
custname = Range("B13")
fname = path & "\" & invna & " " & invno & " - " & custname & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, IgnorePrintAreas:=False, filename:=fname
End Sub
Sub saveinvasExcel()
Dim invno As Long
Dim invna As String
Dim address As String
Dim custname As String
Dim path As String
Dim fname As String
Dim wb2 As Workbook
Dim ws2 As Worksheet
Set wb2 = ThisWorkbook
Set ws2 = wb2.Worksheets("Business Contacts")
path = ws2.Range("F2")
invno = Range("F5")
invna = Range("B3")
address = Range("B22")
custname = Range("B13")
fname = path & "\" & invna & " " & invno & " - " & custname
'copy the invoice sheet to a new workbook
Sheet1.Copy
'then delete all the buttons on the worksheet
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type <> msoPicture Then shp.Delete 'This line is modified so that is doesn't delete the logo
Next shp
'save the new workbook to a specified folder
With ActiveWorkbook
.Sheets(1).Name = "Invoice"
.SaveAs filename:=fname, FileFormat:=52
.Close
End With
End Sub
Sub StartNewInvoice()
Dim invno As Long
invno = Range("F5")
Range("B20,C20,B22:E32,B34:C34,D37,D39,E37,F4").ClearContents
MsgBox "Your next invoice number is " & invno + 1
Range("F5") = invno + 1
Range("B13:C13").Select
ThisWorkbook.Save
End Sub
Display More