EvotecIT / PSWriteExcel

PSWriteExcel is very basic (at the moment) PowerShell module to create Microsoft Excel workbooks without Microsoft Excel installed.
61 stars 12 forks source link

-AutoFit Gives a warning #10

Closed rlburkey closed 4 years ago

rlburkey commented 4 years ago

I have been using your PS Module today, and so far its fantastic! When I try to use the -AutoFit flag on the Add-ExcelWorksheetData command or try to use Set-ExcelWorksheetAutoFit commande I get the following error:

WARNING: Set-ExcelWorksheetAutoFit - Failed AutoFit with error message: Exception calling "AutoFitColumns" with "0" argument(s): "The type initializer for 'Gdip' threw an exception."

Examples of both lines are: Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorksheet -DataTable $MyData -AutoFit -AutoFilter -FreezeTopRow Set-ExcelWorksheetAutofit -ExcelWorksheet $ExcelWorksheet

Any Help is appreciated! Thanks!

PrzemyslawKlys commented 4 years ago

https://evotec.xyz/powershell-core-the-type-initializer-for-gdip-threw-an-exception/