I want to read a range from “workbook123.xls” where the “123” changes from report to report.
I have tried so many things and looked around, where I am now is assign activity to the following
Directory.GetFiles(“C:Reports\output”,"workbook") to a system string variable*
I am getting a string conversion error when trying to pass this assigned variable into excel application scope or excel process. In the screen below as noted I assign my actual file, then was hoping to push it into either Process Scope or Application scope and then read the range of a variable I assign using the sheet index
Any suggestions or ideas on how I can make this work? Am I even on the right path. Once I am able to read the entire worksheet of these workbooks I’ll work on reading the specific table within the file, but that’s for later. Thanks so much.
Ha, yea that worked. I’ll check this out in a bit.
The only thing is Ill want to read not “sheet1” but rather (0). Since the sheet name always changes name as well (and there is always only 1 sheet). So I am hoping your use case here works, but I create a variable for sheet(0) and then read that.
Directory.GetFiles returns an array of string, not a string. ANd you have to have a Use Excel File inside Excel Process Scope, then Read Range inside that. Also I don’t think GetSheets returns the correct datatype for the Range property. I use the Get Sheets activity and then use that array to pass the sheet.
Trouble I am finding there is I can’t find the file “workbook123” with a string search. I need to be able to read workbook123, workbook234, workbook*** or whatever the extension is from day to day.
I can easily put workbook123 into the use excel file>Excel file, but that pulls just that one workbook. I need it to be dynamic in pulling an excel file with a key word in it. The files are brand new every day and there is only one file with that “string”, so I won’t need to loop through every file. I can directly utilize the excel file from day to day, i just need to be able to ID the part of the file name so I can use that for specific use cases.
I tried creating a variable of a string for workbook*.xlsx but it comes up with the string error. I tried to do an object and that too failed. Maybe there is some other combination of using a variable for my dynamic file that will actually work.