Moving a sheet from one excel to another excel

It is [Exceute Macro].

whats the macro name?

name is “MacroCopySheet”

after executing – it says this. I saved the files in my drive and gave the path

image

image

The destination excel should be opened completely before the macro is be execute .

Yes it is opened. You have already give 5 sec delay. in taht delay itself the file got opened but still i increased the delay to 20 secs. still the same error.

How about execute macro only with the 2 excel files?No xaml.

i tried to run and it shows the below and not executing it

image

Please upload your excel files.

Please use this

Target file.xlsx (803.0 KB)

I’m not sure how you did with the sample excel files,
but the point is the name of macro should not like “workbook!modules1.MacroCopySheet”.
It is simply as “MacroCopySheet” like below:.

Maybe you should copy the macro from the “workbook!modules1.MacroCopySheet”
to the book what you want to run macro.

Hi @Subram

I have written an improved macro in your excel what you uploaded.
Target file.zip (747.2 KB)
Open the tow files and run macro on “Target file.xlsm”,to check what will happen.
And I think you will have some further requirement,as you can let me know tomorrow.

Regards.

Thanks a lot!! Now the macro logic works. As you said, i have some further requirements.

The target file will be sent by another person and i will save it in a seperate path. Destination file will also in same path

So – There should be a seperate macro created and saved in the path. The path will have the below file
Macro File
Target file
Destination file

Macro file – We should give the File path and File name to execute
Target file – Macro should go and fetch the data
Destination file – Should save the sheet picked from Target file

HI @Subram

Here is my sample uploaded,please check it.
ThirdPartyMacro.zip (705.5 KB)

Open [Target.xlsm] ,[destination.xlsx] ,then run the macro:ExecuteMacro on [Target.xlsm] .

Thanks for your efforts. Its not running and throws an error. But, i will brief my requirement again.

Macro file will be saved in a folder and it should have the below item

image

I will save the Target and destination file the same folder

The macro should go to the path and read the target file and move the sheet to destination sheet at the end.

Hi – Can you help?