Excel renaming



i have one excel file with mutiple sheets
Want to rename the sheets name


want to change as these names(As names may add…so have to dynamic)


How we can try?Is there any activity

Save as .xlsx


Anybody have Solution?
Is anybody have faced similar
Can Someone guide me on this?



Here is one idea:

Using an Excel Scope use a WorkbookApplication type variable as the output parameter, which will allow you to look at every sheet name in the file. Then, you can perform an Alt-key combination to rename each sheet.

Let’s use “wb” for Workbook and sheetNames for list of sheet names…for the psuedocode below.

Assign sheetNames as Array = { "IPS","IMS","ISP","EMI","LSE","SEO" }
Excel Scope (with wb being output variable)
    For each sheet In wb.GetSheets
        If sheet<>sheetNames(Array.IndexOf(wb.GetSheets.ToArray,sheet)).ToString
            Select Range => A1  ...   sheet
            TypeInto "[k(alt)]hor"+sheetNames(Array.IndexOf(wb.GetSheets.ToArray,sheet)).ToString+"[k(enter)]"

The pseudocode loops through each sheet in wb, selects the sheet, then performs Type Into to do rename sheet from Format menu option using the Index of the sheet for the index of the sheetNames array -EDIT: only if the sheet isn’t already the correct name (shown by the If statement).

I hope this helps.



I have done with this, Some error am facing
During variable type…Pls help with this



see if adding .ToArray next to wb.GetSheets fixes the error.


I will fix my previous post. Thanks.



in, if(sheet<>sheetNames(Array.IndexOf(wb.GetSheets.ToArray,sheet))
i mentioned, is it right? and variable type…
bcz still am facing error, Thanks



Can you be more specific on what the error says that you are still getting? The line you show looks correct.

Also, you will need to remove the “Array” and “sheet” variables that you created. Array is a vb.net function builtin and not a variable, and sheet is defined in the For Each loop so doesn’t need to be declared in variables.



This is am facing


Hi, thanks.

Try using sheet.ToString instead of sheet on that line
If(sheet.ToString<> …

or if that doesn’t help, try doing what the error says and change <> to IsNot
If(sheet IsNot …



sheet IsNot sheetNames(Array.IndexOf(wb.GetSheets.ToArray,sheet)) now its not showing error,

But while running, its throw this

and while giving Select Range, specified range with " ", Is it Correct?


Nope, but you almost got it. So I pulled up Studio and tested this and you just need to use sheet.ToString<>

Here is an image:

That worked for me.

Thanks and regards.


Oh also check the TypeInto activity, it should be:



You can use VBA code to rename multiple worksheets by the name you want at once.


Am still facing Error in If Condition
and Type Into, its no error.
Can u send the xaml file, or send the screen shot fully.


This is my XAML file, what i did wrongRename.xaml (22.7 KB)


Hi there @Sharanabasava

You are using the variable “items” as your sheetNames variable so replace “sheetNames(” to items(
and that should take care of the validation error.

Below is the screenshot, where I highlight the sheeNames type says List<WorkbookApplication> which is wrong, however you are not using that as your variable so you can delete it completely. I also highlight items under variables because that is the variable you are using to store your sheet names in.

I hope that makes sense. So, just replace sheetNames( in both your if condition and Type into activity to items( where you are assigning your sheet names in.

fixed version: Rename.xaml (22.3 KB)



Programmatically renaming - test it

excelRename.xaml (11.4 KB)



Thanks to all.
and Special Thanks to ClaytonM and Vvaidya:grinning: