Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of PowerShell errors when generating a report #27

Open
benji1000 opened this issue Feb 22, 2024 · 1 comment
Open

Lots of PowerShell errors when generating a report #27

benji1000 opened this issue Feb 22, 2024 · 1 comment

Comments

@benji1000
Copy link

Hello,

when generating a report, I get tons of PowerShell errors. The Excel file is generated and usable, but I don't know what these errors mean, and if they are preventing something from being generated in the report. I also think they should be eliminated for the sake of not having erros when running the tool 😊

Here are a few of these errors. My system is in French, so I did my best to translate them.

Value doesn't belong in the expected range.
At D:\tools\adrecon\ADRecon.ps1:5509 : 17
+ ...             $worksheet.Range($ObjValues[$i]).FormatConditions.Add([Mi ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException
Invalid index. (HRESULT exception: 0x8002000B (DISP_E_BADINDEX))
At D:\tools\adrecon\ADRecon.ps1:5514 : 17
+ ...             $worksheet.Range($_).FormatConditions.Item(1).StopIfTrue  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
Cannot find an overload for « Style » and the number of arguments: « 1 »
At D:\tools\adrecon\ADRecon.ps1:4960 : 5
+     $worksheet.Cells.Item($row,$column).Style = "Heading 2"
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
    + FullyQualifiedErrorId : RuntimeException
HRESULT exception: 0x800A03EC
At D:\tools\adrecon\ADRecon.ps1:5914 : 17
+ ...             Get-ADRExcelChart -ChartType "xlPie" -ChartLayout 3 -Char ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

You can get here a ZIP file containing the full error log, the CSV files, and the generated Excel file: ADRecon.zip

This was run on a testing environment, but the same errors happen on real environments.

Could you look into it and tell me why these errors occur, or what can I do to help you fix them?

@Seth401
Copy link

Seth401 commented Oct 12, 2024

$worksheet.Cells.Item($row,$column).Style = "Heading 2"

The errors referencing this are caused by using a non English office installation. The default template names are not translated. For a German installation, replacing "Heading 2" with "Überschrift 2" works to fix them, or just uncommenting the couple of lines. It is just a heading format.

In my case, the generated Excel file will still show up as needing repairs (on German and English office installations).

Removed Feature: Conditional formatting from /xl/worksheets/sheet21.xml part

Essentially, for whatever reason, office doesn't like the conditional formatting on that sheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants