ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using ExportAsFixedFormat (https://www.excelbanter.com/excel-programming/423178-using-exportasfixedformat.html)

mathieu

Using ExportAsFixedFormat
 
Hi there,

I am banging my head trying to use: ExportAsFixedFormat.
I am using Excel 2007, with PDF export, everything works fine doing
it by hand. All I am trying is:
- open the xls file (1997 format)
- add some charts
- export to pdf

But I get this funky error saying that my file is not saved. If I try
then to save it as .xls file, my charts become green (don't ask). And
if I try to save it as ".xlsx" I cannot reopen the file, Excel tells
me that the file is not recognize:

....
wb.SaveAs( fullpath ) # how do I specify I want the new .xslx format ?
wb.Close( )

# reopen to please Excel about "unsaved workbook"
wb = xl.Workbooks.Open( fullpath )
ws = wb.Worksheets(1)

ws.ExportAsFixedFormat(Type=constants.xlTypePDF,
Filename=fullpath_pdf, Quality=constants.xlQualityStandard,
IncludeDocProperties=True, IgnorePrintAreas=False,
OpenAfterPublish=False)
....

Thanks !

Dave Peterson

Using ExportAsFixedFormat
 
I don't use xl2007 enough to help, but maybe Ron de Bruin can:

http://www.rondebruin.nl/saveas.htm
and
http://www.rondebruin.nl/pdf.htm

mathieu wrote:

Hi there,

I am banging my head trying to use: ExportAsFixedFormat.
I am using Excel 2007, with PDF export, everything works fine doing
it by hand. All I am trying is:
- open the xls file (1997 format)
- add some charts
- export to pdf

But I get this funky error saying that my file is not saved. If I try
then to save it as .xls file, my charts become green (don't ask). And
if I try to save it as ".xlsx" I cannot reopen the file, Excel tells
me that the file is not recognize:

...
wb.SaveAs( fullpath ) # how do I specify I want the new .xslx format ?
wb.Close( )

# reopen to please Excel about "unsaved workbook"
wb = xl.Workbooks.Open( fullpath )
ws = wb.Worksheets(1)

ws.ExportAsFixedFormat(Type=constants.xlTypePDF,
Filename=fullpath_pdf, Quality=constants.xlQualityStandard,
IncludeDocProperties=True, IgnorePrintAreas=False,
OpenAfterPublish=False)
...

Thanks !


--

Dave Peterson


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com