How to Display in textbox the last sheet in excel if we use get workbook sheets activity

How to Display in textbox the last sheet in excel if we use get workbook sheets activity

in the picture, i would like to get the April 7 to be displayed in the text box


image

Hi @Joshua_Ducao,

Try this.

sheetsVariable(sheetsVariable.count).Tostring

Or

sheetsVariable.Last

Hope it helps.

1 Like

Hi @Joshua_Ducao ,

Please add this below code in message box,
sheets.LastOrDefault

where, sheets → Output of the Get Workbook Sheets activity.

And let us know if its working for you?

1 Like

sheetsVariable.Last Works but sheetsVariable(sheetsVariable.count).Tostring doesn’t, like it looking for a range of sort.

Thanks sheets.LastOrDefault works

Thanks for the solution

1 Like

My bad, it should be sheetsVariable(sheetsVariable.count - 1).Tostring

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.