Good day.
I've been reading Excel automation threads most of this AM looking for a solution to my issue. I have a report with 8 data items (7 are nested under 1 parent, some of these are again nested under others). I have been asked to output this to excel with different sheets for most of the different data items.
I have been successful in adding sheets and writing relevant data to each, the problem is that when the next record in the parent data item is retrieved, I need to switch back to the proper sheet that was created on the first iteration of the data item. Thus far, I have been unsuccessful, such that after the first parent record is output to all sheets, all subsequent parent record output is to the most recent sheet used.
I have tried several different syntax - some threw automation errors, others appear to do nothing (no error, but no result). I'm sure someone here has done this and I would greatly appreciate any suggestions. Thanks!
Some of the commands I have attempted:
XlApp.ActiveWorkbook.Sheets.Select('Sheet Name'); //no errors, but no change in output
XlSheet := XlBook.Worksheets.Item('Sheet Name'); //no errors, but no change in output
XlSheet.Activate;
kind of fell into this...
Answers
KCP Consultores
KCP Consultores
i made some changes and it looks like i'm on the right track, thanks again!