ExportAsFixedFormat - error message instead of image

jdonkers

New Member
Joined
Jul 31, 2012
Messages
1
I've created a web service that generates a dynamic Excel file that has charts and images, and converts it to pdf using ExportAsFixedFormat. I've managed to get it working perfectly on my development machine. Installed is Excel 2007 (v12.0.6661.5000) SP3 MSO (12.0.6607.1000) on Windows 7 Pro x64.

Basic code (using C#):
Code:
workBook = app.Workbooks.Open(@"C:\temp\Original.xlsx", Type.Missing, true, Type.Missing, Type.Missing, Type.Missing, true, Type.Missing, Type.Missing, false, false, Type.Missing, false, Type.Missing, Type.Missing);

workBook.Activate();

workBook.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF, @"c:\temp\testexport.pdf", Type.Missing, false, true, Type.Missing, Type.Missing, false, Type.Missing);

The problem is that when I run the same service on our test server, one of the images (ie. not all) doesn't show up. Instead is the message
The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.
The server has the exact same version of Excel, but is on Windows Server 2008 R2 x64. I've also tried it with the same source .xlsx file. The only other major difference is maybe that I have Adobe Acrobat X installed on my machine, but I don't think that should matter. Memory should not be an issue.

The same thing happens on our production server as well when I tried a test there.

I have also tried using a third party application (activePdf Server), but am having the exact same issue with the image. It works fine on my machine, but not the server.

Can anyone please help me with this?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,226,730
Messages
6,192,698
Members
453,747
Latest member
tylerhyatt04

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