Cannot find type [OfficeOpenXml.ExcelPackage]: verify that the assembly containing this type is loaded.
johnpeck09 opened this issue · comments
Greetings,
We receive the following error when we use the Import-XLXS module to try to combine 2 excel files in PowerShell 5.
PS C:\windows\system32> $L = Import-XLSX C:\Users\Public\KBs\SecurityUpdates.xlsx
Import-XLSX : Failed to open 'C:\Users\Public\KBs\SecurityUpdates.xlsx':
Cannot find type [OfficeOpenXml.ExcelPackage]: verify that the assembly containing this type is
loaded.
At line:1 char:6
+ $L = Import-XLSX C:\Users\Public\KBs\SecurityUpdates.xlsx
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Import-XLSX
I look forward to hearing back from you soon concerning this issue.
Hi John!
A few questions:
- How did you install PSExcel?
Install-Module PSExcel
? Download the zip from GitHub and extract somewhere? If the latter, you'll need to unblock the zip (or the files in it, particularly the dll in/lib
) - Where is the module installed? Network shares won't be an option in most cases, given the dll
- How did you import the module? Guessing this isn't the case, but you can't selectively use
Import-XLSX.ps1
, the module itself needs to load
Cheers!
Good news, we got the module working; however, we are still having the following issue. When we import the xlsx one sheet has embedded URLs and the other is for a join-object key. when we do a "join-object" and export-xlsx, why doesn't it keep the URLs?
I appreciate the help.
- John