PrintArea not respected in Excel French

cabral_ea_ca

New Member
Joined
Nov 19, 2013
Messages
2
I have a c# program to printout a specific worksheet as seen below
-------
Microsoft.Office.Interop.Excel.Application w_ExcelAppl =
new Microsoft.Office.Interop.Excel.Application();
w_ExcelAppl.DisplayAlerts = false;
w_ExcelAppl.Visible = false;
w_ExcelAppl.AskToUpdateLinks = false;
w_ExcelAppl.EnableEvents = false;
object w_Optional1 = Type.Missing;
bool w_UpdtLink = false;
bool w_ReadOnly = true;

Workbook w_ExcelWrkbook = w_ExcelAppl.Workbooks.Open(
".\\ExcelSample.xlsx",
w_UpdtLink,
w_ReadOnly,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1,
w_Optional1);

int w_Idx = 1;
Worksheet w_ExcelWrksheet = (Worksheet)w_ExcelWrkbook.Worksheets.get_Item(w_Idx);

foreach (Name w_Name in w_ExcelWrksheet.Names)
{
MessageBox.Show(w_Name.NameLocal, w_Name.Name) ;
}

object w_Optional2 = Type.Missing;
w_ExcelWrksheet.PrintOut(w_Optional2, w_Optional2, w_Optional2, w_Optional2, w_Optional2, w_Optional2, w_Optional2, w_Optional2);
bool w_Save = false;
object w_Optional3 = Type.Missing;
w_ExcelWrkbook.Close(w_Save, w_Optional3, w_Optional3);
w_ExcelAppl.Quit();
w_ExcelAppl = null;
-------

The worksheet has a defined print area and is printed correctly in an English Windows 7 with a English Excel installed.
When I run the above code in a French Windows 7 with a French Excel installed, the print area is no longer respected and the whole sheet is printed.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,821
Messages
6,121,762
Members
449,048
Latest member
excelknuckles

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