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

Excel - Invalid Index #1

Open
chrisATautomatemystuff opened this issue Dec 17, 2015 · 0 comments
Open

Excel - Invalid Index #1

chrisATautomatemystuff opened this issue Dec 17, 2015 · 0 comments

Comments

@chrisATautomatemystuff
Copy link

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

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

No branches or pull requests

1 participant