ImportExcel icon indicating copy to clipboard operation
ImportExcel copied to clipboard

ImportExcel can't autosize, even though mono-libgdiplus is installed

Open jamacoe opened this issue 3 years ago • 2 comments

I get the following message when using import-excel with Powershell on OSX:

WARNING: ImportExcel Module Cannot Autosize. Please run the following command to install dependencies:    
brew install mono-libgdiplus

However, mono-libgdiplus is installed and I even reinstalled. All software is up-to-date:

Mac OSX Big Sur 11.6.8 (20G730)
Homebrew 3.5.10
mono-libgdiplus 6.1_1
Powershell 7.2.6
Powershell Module ImportExcel 7.8.0

What's wrong, what can I do?

jamacoe avatar Aug 25 '22 15:08 jamacoe

Could be the check for that needs to be updated. Can you still use -AutoSize? Does it work? Or no go?

dfinke avatar Aug 25 '22 17:08 dfinke

Sorry, I've no idea as I'm not using this software regulary. I followend an article (https://adamtheautomator.com/powershell-excel/) using ImportExcel and advising to install mono-libgdiplus on the mac, so I did it. I worte the program some time ago and I never noticed this warning I'm reporting, so I guess it's probably new due to some updates. However, the mere import of the Excel files seems to function. In my program I'm using '-Autoresize' only if !($IsMacOS) - thus on Windows, and I don't recall what it is supposed to do

jamacoe avatar Aug 26 '22 12:08 jamacoe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 01 '22 07:10 stale[bot]

@dfinke Encountering the same with PS 7 Core.

libgdiplus is already the newest version (6.0.4+dfsg-2).
libc6-dev is already the newest version (2.35-0ubuntu3.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Importing required Module: 'ImportExcel' ...
WARNING: ImportExcel Module Cannot Autosize. Please run the following command to install dependencies:
apt-get -y update && apt-get install -y --no-install-recommends libgdiplus libc6-dev

Gill-Bates avatar Dec 02 '22 14:12 Gill-Bates

@ili101 wondering if you know more about this?

dfinke avatar Dec 04 '22 01:12 dfinke

It looked like .Net 6 drooped support for it on non-windows System.Drawing.Common only supported on Windows. So it looks like it's not going to work on PS 6.2 and up? EPPlus 6.0.3 stopped using it as a dependency https://github.com/EPPlusSoftware/EPPlus/issues/572 I don't see how we can make it work on new PS versions 🫤

ili101 avatar Dec 04 '22 21:12 ili101

Thanks @ili101 wanted to get your confirmation.

dfinke avatar Dec 05 '22 16:12 dfinke

I am seeing the same issue from azure github actions.

  - name: Run PowerShell script
    uses: azure/powershell@v1

Can you please help with the workaround?

BhavanaSaiT avatar Mar 26 '24 16:03 BhavanaSaiT