Help with setting up "Save Excel File As"

I am using 'Save Excel File As" within a ‘Use Excel file’ activity. I need assistance in performing the following.

An app separate from Excel generates an Excel spreadsheet and launches the result as “Book1.xlsx.”

I need to save that file to a specific location and with a specific name.

I have tried referencing the generated sheet as ‘book1’ using a string variable. It saves a blank file.

The location works in the second box; I just have been unable to save the actual sheet instead of a blank one.

How do I properly reference the ‘Book1’ sheet so that it can be saved?

Hi @bob_carl

Use “Use Application/Browser” to attach Book1.xlsx, then inside it use “Use Excel File” with Excel.CurrentWorkbook as input. Add delay if needed, and use “Save Excel File As” with your desired path. Avoid referencing “Book1” directly.

I’m new to StudioX, but I want to help.

Is the generated Excel file always named as “Book1.xlsx”? If yes, I’d do the following:

Wait for Download or File Exists >
IF the file is ready >
Then: Move File
Else: Blank

I am trying to locate “Excel.CurrentWOrkbook” for the input. I go into Advanced Editor on the first box 'Excel file". I type ‘Excel.Cu’… however ‘Excel.CurrentWorkbook’ is not an present as an option. Alphabetically I have ‘Excel.CopySheet’ and then it ‘Excel.CreateTable’.

@bob_carl

Ideally you cannot attach to an already open excel file and which is not saved..the way to do it would be to use ui automation and click on file and saves as or pss ctrl+s and then type the name in save as window

Cheers

That is how I did it previously. I was trying to use a more efficient method with a direct save rather than navigating through multiple screens.

There is obviously room for improvement here.

Train of thought:
I have an Excel file called Book1.
I need to save it with a specific name.
The activity is called ‘Save Excel File As’.

There has got to be a way for this to work; otherwise it should be addressed in the HELP page.

Thank you for taking the time to respond.

@bob_carl

Save excel file as is used to save already existing excel file with sifferent extensions

You need to understand one thing here is that a handle is needed for these activities to work and the handle is provided by use excel file and for use excel file to create a hnfle you need to specify an input file as book1 is not saved at all there is no way to give the path

One way you can try is to use macros and then attach to book1 and try saving it..but only with activities you cannot

All the best

Cheers