Save PO or Invoice to another file, clear contents and create a new blank form

CBelli

New Member
Joined
Feb 11, 2020
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
I am trying to save a PO to another folder on our local network then clearing the information and automatically generating another invoice number and new sheet to write a new PO: Here is the VBA language I was using, which was working but now is not working and I keep getting an error 1004 SaveAs of object Workbook Failed. Any help would be appreciated. Thank you.

Sub SavePOWithNewName()
Dim NewFN As Variant
' Copy Purchase Order to new workbook
ActiveSheet.Copy
NewFN = "T:\Winemaking\Oak Alternatives\2020 Oak Alternatives\2020 Purchase Orders\FCC20-" & Range("F5").Value & Range("B10").Text & ".PDF"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
 
No, I don't have any extra characters. I did try value. Same message. :-(
 
Upvote 0
You can try the macro in a new book, on a new sheet, just put the data on the sheet

in F5: 505
in B10: Stavin

and run the macro
 
Upvote 0

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