Setting Excel FitToPagesWide to "Automatic" in C # (VTSO)

When I write a macro to excel to set FitToPagesTall = 1 and leave FitToPagesWide as "Automatic", it sets FitToPagesWide to 0. However, these errors are when using C # (using VSTO).

sheet.PageSetup.FitToPagesWide = 0;

Any ideas? I tried installing to NULL to no avail.

+3
source share
1 answer

Found.

You must set the value to false. sheet.PageSetup.FitToPagesWide = false;

+4
source

Source: https://habr.com/ru/post/1785943/


All Articles