I am new to office scripting so I may be a little off base but here goes:
As with so many, I need to create tables in Excel workbooks that are received via email. The added challenge is that the workbooks may have one to six worksheets and I need to create a table in all worksheets present. The one thing working in our favor is that there are only 6 sheet names for the users to select from. For the sake of simplicity lets say the sheet names are red, blue, green, yellow, black and white. One workbook may contain the worksheets red and white, while another workbook may contain all 6 and another only contain green.
The Microsoft documentation seems to be saying that using a variable for the sheet names in scripting. But the only options I have seen for selecting a sheet are to select the first sheet or the active sheet.
I need some way to select each sheet that is present. Does anyone have a solution that will do this?