Excel/Excel macro stopped working
this macro is no longer working and i can't debug it. i am getting a runtime error 1004 document cannot be saved. it has worked for 2 years. we have not upgraded excel or changed printing options.
Do you see an error/change?
When i try to debug the section beginning with bk.Export thru openafterpublish is highlighted.
' EFT_Receipt Macro
' To pdf the customer receipt
' Keyboard Shortcut: Ctrl+r
ActiveSheet.PageSetup.PrintArea = "$E$2:$G$50"
Dim sh As Worksheet, bk As Workbook
Dim sPath As String
Set sh = ActiveSheet
sPath = "p:\customer service\vanco bestbill services\"
Set bk = ActiveWorkbook
sName = bk.Worksheets(1).Range("F8").Text & ".pdf"
bk.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=sPath & sName, _
the bk.ExportAsFixedFormat command is provided by the save as PDF addin to the best of my knowledge. I would guess that the addin is not installed/loaded. (install/load it)
If it is, then perhaps you path is no longer valid or you have a file with that name already in the specified location.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here