2 Macro Issues
Sub SaveAsFile: I have the same macro for a PDF conversion, and it works. For whatever reason, when I use the below, it doesn't save the excel macro enabled workbook to the same path the file is in. Once I get the SaveAsFile done, I want to add another macro at the bottom that saves the excel in the same location with the current date at the end upon opening.
- Sub SaveAsFile()
- ' SaveAsFile Macro
- WBPath = ActiveWorkbook.Path
- WBName = Replace(ActiveWorkbook.Name, ".xlsm", "")
- CustomerName = ActiveSheet.Range("B1").Text
- PricingAnalysis = ActiveSheet.Range("B3").Text
- currentDate = Format(Date, "MM.DD.YYYY")
- newFullPath = WBPath & "\" & WBName & " " & currentDate & ".xlsm"
- ActiveWorkbook.SaveAs Filename:=CustomerName & "_" & PricingAnalysis & "_" & currentDate & ".xlsm"
- 'FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
- End Sub
- **Commented out as of now because the top macro won't work correctly**
- 'Private Sub Workbook_Open()
- 'Call SaveAsFile
- 'End Sub