You won't get an indented BOM into excel, but if you export the structured all levels BOM with the item column included, the item column will give a good structure for sorting and manipulating data.
I would advise you to set the number of figures in the item number to the maximum number of parts.
For example if you have over 10 parts set the item values to 00, <100 parts set 000, <1000 parts 0000 .... this will make it easier in excel.
Here's approach described here:
Inventor API Product Designer
I wrote some code to do essentially the "opposite", that is, import the structure into excel of the current Inventor assy.
Some code tweaking will be necessary to suit your filing structure, and iProps that you wish to import (we have several custom ones). (Plus no doubt you will find more efficient ways of doing some things. This is not documented/commented as fully as it could/should be..)
Place this code into an Excel code module, and run RetrieveInvAssyDetails()
This will overwrite any cell content, so the best be is to use a new sheet.
Edit: you should start by modifying line 38. All our file names should start with 700... hence this line.
============================================= This is my signature, not part of my post.