Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Batch File to Copy Sheet to another Excel File

KamenRider
11 - Bolide

Good Day,

 

Is there anyone from you who could write an autoexec.bat file that will copy the sheets to another excel file? The copy will be a clone with out any changes in the file formats. I am not very much knowledgeable on this but I am thinking maybe this will works since I have tried lot of things to solve this. I have a master file with multiple sheets and I would like to add a sheet coming from different excel file. I have tried many ways like using the blob tool but it is not working.

 

Below are two sample excel file. The goal is to copy the sheet from Control.xlsx to Financial sample.xlsx without any changes in its formats. Financial sample is the master file.

 

Looking forward for some bright ideas there.

 

Kamen

43 REPLIES 43
KamenRider
11 - Bolide

Hi @flying008 

 

First of all, thanks for your patience. happy vacation.

 

I found some misspelled in my work and corrected it from Financial to Financial. I've increased the BAT character to 3048. The truncation was gone but I still have some errors. The good news is that it is now able to produced the output. Please below snapshots in that maybe you can help me fix the errors.

 

Snapshot coming from Sample Tool

 

Gig03.PNG

Snapshot from Run Command Tool

 

Gig04.PNG

Results after Running the workflow

 

Gig5.PNG

Errors found

 

Gig01_error.PNG

Gig6.PNG

Output - it produce the output I am looking for.

 

Gig_Output.PNG

I think we are near to solve the issue. Need to solve the errors. Please advise.

 

Kamen

flying008
15 - Aurora

Hi, @KamenRider 

 

It's nice to see that the code finally does what you want on your machine. According to the prompt, some of the code for kill process requires you to run it with administrator privileges, so in order not to affect your normal function execution, please remove this part of your code &&@taskkill /f /im excel.exe  .

 

By the way, please check if you have ntsd.exe this file in the C:\Windows\System32 directory?

KamenRider
11 - Bolide

Hi @flying008 

 

Removing the "&&@taskkill /f /im excel.exe" works. In line to ntsd.exe you have mentioned, I can't access the file since our drive C is somewhat inaccessible. We are given home drive to save our files.

 

Anyway thank you so much for your patience and your 100% assistance. Your expertise has greatly help me in completing this task. I have learned something from you and this BAT file of your will be very much helpful in my other projects.

 

Thank you,

Kamen

 

 

flying008
15 - Aurora

Hi, @KamenRider 

 

It's been more than a month, and I'm glad we finally solved this problem together, I wish you a pleasant day! 😁

Labels
Top Solution Authors