How to save existing opened excel file to a new excel file without overwriting

Hi guys, I’ve just joined RPA a couple of weeks ago and I’m having a mini project to extract data from the web and write into an excel file. I able to extract the data but now I’m struggling with saving the file into a new file with a timestamp without overwriting the existing excel as this will be a daily recurring process. Please help me out :slight_smile:

2 Likes

Are you able to write the data in excel using the exctracted data in web? @sam.lee

cheers :smiley:

Happy learning :smiley:

3 Likes

Yes, all the data were extracted to the existing excel, just that now I need this excel to save as a new excel file

1 Like

Hi @sam.lee
You want to create a new excel file in the excel file that you created right?
Why dont you write the data in two different excel files!

or maybe you can use this link for your reference.
Copy Sheet

cheers :smiley:

Happy learning :smiley:

4 Likes

Hi @pattyricarte

Because the first excel file is a template with headers in it, so I extract whatever data needed and fill into the cell relatively and then save it as a new file. So the first file will remain the same with any data in it.

1 Like

Little bit of an addition again to @pattyricarte mentioned… :slightly_smiling_face:

If you want to create new file for each run, you can use the write range as well. There for the file name, make the file name dynamic by including the time stamp to the name of the file. So for each run it will create a new excel file with the time it got created.

If you are to add them to the same sheet in the same file, use append range so that it will not overwrite existing data. Additionally to distinguish the new with old, have a new column that has the date and the time. You can do this before writing by adding a column to the datatable and getting it updated with the date.

2 Likes

Hmmm @sam.lee
okies in that excel you just need some data and input it to new excel depents on your condition am i right ?

cheers :smiley:

Happy learning :smiley:

2 Likes

Hmm… if that’s the case I think we can combine the ideas of @pattyricarte and mine. Bro @pattyricarte correct me if I’m wrong here…

First we can do a copy sheet as you said to get the template to a new file
Then, if there is no new data, we can do a write range starting right below the headers of the template. It will not overwrite what’s above.
And going forward we can use append range so it will keep on adding the data without overwriting

Or for each run if we need a new file we can use the first two steps

2 Likes

@Lahiru.Fernando brother ,I guess what @sam.lee want are, After creating excel file he/she just want to get data for that excel and insert it to another excel file.
What i am thinking right now. is just modify the Datatable and do some query on it and save to excel! am i right @sam.lee

cheers :smiley:

Happy learning :smiley:

4 Likes

Hello @sam.lee

You mean you have a template or you keep a record of all of the data.

I think it’s pretty simple, it’s just an f12 action?

can you please elaborte more, I will suggest to see the logic for save as.

regards

1 Like

Appreciate for both of your helps guy @Lahiru.Fernando @pattyricarte

I will try to explain how I created the process currently.
My current step is:

  1. Open Browser
  2. Open Excel
  3. Data Scrapping (I will get data from Ticket/Parent/Created by)
  4. Write Range (key into the Excel opened in step 2)
  5. For Each Row (Looping through the data scrapped)
  6. Click Activity(to click each “Parent” data to further scrap whatever data needed inside, “Parent” is a clickable link that will navigate to show the data in it)
  7. Screen Scrapping
  8. Write Cell (key in data to Excel relatively)
  9. End (This is the part where I want to save it in a new excel file)

Thanks ! :smiley:

3 Likes

Hi @beesheep

I have a template file which I don’t want to overwrite it, by using the template file and further key in data and then save it as a new file(probably with Data&Time).

By the way @sam.lee what data do you want to write in new Excel File ?
I ask because we can get the datatable of First excel and do some query on it and write it to another excel file ?

cheers :smiley:

Happy learning :smiley:

3 Likes

@sam.lee

Alright. so to summarize, you open the excel in step 2 (which is your template I believe) and you add the data to it. and in step 9, you want to save that excel to a new file right?

So if that’s the case, I would change the steps slightly like this…

  1. Open Browser
    2. Copy Template Excel into a new Excel (Copy sheet activity)
    3. Open the new excel sheet
  2. Data Scrapping (I will get data from Ticket/Parent/Created by)
    4. Write Range (key into the Excel opened in step 3)
  3. For Each Row (Looping through the data scrapped)
  4. Click Activity(to click each “Parent” data to further scrap whatever data needed inside, “Parent” is a clickable link that will navigate to show the data in it)
  5. Screen Scrapping
  6. Write Cell (key in data to Excel relatively)
    9. Save the new excel sheet using save workbook activity

Does this help?

6 Likes

Hi @pattyricarte,

First I will extract some numbers from Ticket & Parent, then an email address from “Created by”.
Secondly I will click into Parent and screen scrape some data such as title, description, categories and so on.

1 Like

Hi @Lahiru.Fernando

Really appreciate for your help, will try this on later ! :grin::grin:

2 Likes

Hi there @sam.lee

Welcome to uipath community…

Adding to the solutions aforementioned, I guess you can use copy file activity also to create a clone of the file and in the output name you can use the date time stamp naming convention which will effectively rename the file also :slight_smile:

Regards

1 Like

Hey great news @pattyricarte @Lahiru.Fernando

I able to done it using copy files activity. Thank you so much for all your assist and advise!! :blush::100:

2 Likes

Awesome!! Great work!!! :slight_smile:

2 Likes

yey Great to know @sam.lee

cheers :smiley:

Happy learning :smiley:

2 Likes