Page 1 of 1
VBA copy files
Posted: Fri Sep 25, 2020 6:00 pm
by sna
Hi
Dear
I need your help with copy and paste from folder.I test code is ok but if I copy this file is not working.
I attached working fine and source file
Best Regards,
Re: VBA copy files
Posted: Fri Sep 25, 2020 7:38 pm
by snasui

Could you please capture the error and attach here?
Re: VBA copy files
Posted: Fri Sep 25, 2020 10:17 pm
by sna
Hi Dear,
It doesn't show any error but it doesn't copy the desired output.
I don't know why .I step through the code but nothing occur.
What's wrong with?
Best Regards,
Re: VBA copy files
Posted: Sat Sep 26, 2020 7:51 am
by snasui

Change
MyFile = Path & "*.xls*" to
MyFile = Dir(Path & "*.xls*") and if you want to loop other file in this path, add
MyFile = Dir() after
Application.DisplayAlerts = True statement.
Re: VBA copy files
Posted: Sat Sep 26, 2020 3:05 pm
by sna
Thank you

Re: VBA copy files
Posted: Mon Sep 28, 2020 2:46 pm
by sna
I try as suggested but no luck.
It has problem copy and paste .it open file but not copy n paste
Re: VBA copy files
Posted: Mon Sep 28, 2020 5:32 pm
by sna
It sometimes can't open file.what is wrong?
excel file is always extension .xlsx
Re: VBA copy files
Posted: Tue Sep 29, 2020 10:08 pm
by snasui
sna wrote: Mon Sep 28, 2020 5:32 pm
excel file is always extension .xlsx

It should be '.xlsm'.