I am trying to create a PDF from an Excel spreadsheet. My code creates a PDF but when I try to open it, I receive an error that the "document is not a suppoted file type or because the file has been damaged". My active printer (default printer) is currently set to Adobe PDF.
Attached is a snippet of my code.
Thanks in advance.
Dim oExcel As New Excel.Application
Dim oWorkbook As Excel.Workbook
Dim oSheet As Excel.Worksheet
Set oWorkbook = oExcel.Workbooks.Open("c:\temp\temp.xlsx")
Set oSheet = oWorkbook.Sheets("Sheet1")