Reputation: 45
I am using a script to export data from SAP to Excel. The goal is to make this macro work for anyone that would attempt to run it, however, if they have a different SAP layout then the macro is messed up. Digging through the code it looks like SAP is assigning a number value to each row. So the macro runs the SAP transaction, then changes the layout and dumps all of the displayed columns in the layout over to the right based on which number it's referencing. Now this works fine when I run it because the final column is always the same, but if someone with a different layout were to run it then they would only remove some of the fields.
What I'm wondering is if there is a way in VBA to select all of the rows or completely clear the "Displayed Columns" bucket, rather than the current code which is:
session.findById(PLACEHOLDER).selectedRows = "0-27"
Basically, I need a blank slate to have the macro set up the export properly but I'm struggling to give everyone the same blank slate if they have a different SAP layout.
Any help is appreciated.
Thanks.
Upvotes: 0
Views: 532
Reputation: 45
Found the answer shortly after posting. Instead of using:
.selectedRows = "0-27"
I used:
.selectAll
This grabbed everything in the field so I could then repopulate with the information I needed.
Upvotes: 2