Getworksheet multiple columns

fhigawa

New Member
Hello,

I need to select 3 columns from one worksheet and get as collection, without editing the original file.

I tried Get as Range

StartCell "D5,I5,M5"
Endcell "D31,I31,M31"
But received the following error:
"Internal : Could not execute code stage because exception thrown by code stage: Exception from HRESULT: 0x800A03EC"

Is there anyway to do this or just getting one by one and appending then to a 4th collection?
Also, how can I tell blueprism, to read until the last cell with data.
 

VJR

Well-Known Member
Hi fhigawa,

You can get all the columns into the collection and then use 'Delete Column' to remove the unwanted ones. Else you will have to write a Code stage to get only the required columns.

For getting the last cell with data there is an action in the MS Excel VBO called as 'Get Number of Rows' and then use that data item - eg; "D" & [LastRow]. If LastRow is 31 then its outcome is D31.
 

fhigawa

New Member
@VJR Hi

I understood what you said, but I'm not a programmer, to be honestly, but I'll look on google, how to code it, thanks.

to delete multiple worksheets, I'm trying "ABC" & "AB" & "CCCC" & "DDDD" in a Action Btn (VBO - Delete Worksheet), but its not working. Do I need a code, like in delete columns ?
 

VJR

Well-Known Member
Hi fhigawa,

The original question is about deleting columns and not sheet so not sure why you wish to use Delete Worksheet.
I was referring about deleting the columns in the collection (once you get them in the collection) and not from the sheet.

(In any case if you want to delete the sheet and if you use "ABC" & "AB" & "CCCC" & "DDDD" then it will consider a sheet name as "ABCABCCCCDDDD" which is not the case. The Delete Worksheet is designed in such a way that you will have to use 1 Delete worksheet action at a time for deleting 1 sheet. Or you can (without a code stage) loop through the GetWorksheetRangeAsCollection and use 1 single Delete Worksheet action by using a Decision stage to check each sheet name inside the loop.)
 
Top