Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Excel - Invalid Index #1

@chrisATautomatemystuff

Description

@chrisATautomatemystuff

silverhack,

I was trying to run this script today and export to excel. I was met with:

"Exception getting "Item": "Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))"

I've been reading about the error online and see some solutions talking about $var.workbook.add() vs. $var.worksheet.add(), but I'm unsure where it's failing.

I took a stab at it and commented out lines 33-36 and the scripts appears to have run successfully and produced a pretty excel file for me. It looks like those lines were attempting to delete the extra two worksheets that usually get created with a new Excel file. I don't know if it changed in Excel 2013 or if the environment I'm in has anything in place to limit the number of worksheets in a newly created workbook.

I don't know if this is something you'd want to add an if-statement to in order to determine the Office version before attempting to delete the excess sheets.

Thanks for the tool though. I'm looking forward to really reading through the script to learn more about how you're pulling this information.

-Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions