Hello this code was working perfect and today has stoped. I don't know why it is showing runtime error 1004
![]()
Please Login or Register to view this content.
Hello this code was working perfect and today has stoped. I don't know why it is showing runtime error 1004
![]()
Please Login or Register to view this content.
Last edited by Anto_BT; 05-26-2015 at 10:58 AM.
What's the error message?
If posting code please use code tags, see here.
Have you added any new worksheets to the workbook? What is in cell V1 in each of the worksheets? Are the characters valid in a file name? Does it contain a date? Does the file already exist?
Might be helpful to provide a sample workbook based on the live file.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Untitled.jpg
this is the message
No there is not new worksheet, on V1 is always the same "05.2015". The folder exist yes!
When you get the error is the worksheet you are trying to save as a new workbook named 175CAC20?
What format do you want to save the new workbook? eg xlsm, xlsx
Now the name needs to be "SheetName_05.2015" I want to save in xlsx.
Thank you for helping![]()
Does this work?
PS Is D a mapped/network drive?![]()
Please Login or Register to view this content.
D is Local Disk and it is not working your code
Try putting some Debug statements in. This will tell you what is happening; which sheet is being processed, the contents of cell V1 on the sheet, the full path of the file to be saved ... and how many sheets/files have been processed.
![]()
Please Login or Register to view this content.
Output:
![]()
Please Login or Register to view this content.
The routine, as it stands, works OK for me. Have V1 in cell v1 on Sheet1, V2 in cell v1 on Sheet2, V3 in cell v1 on Sheet3. If I run the subroutine a second time, it still works but it asks me if I want to replace the existing file, which is as expected.
So, back to what's in the cell on each sheet? Which sheet fails? Is it the first one? Or has it processed some sheets before it fails? If it has processed some successfully, that would imply the hard disk and the folder/sub-folder structure is OK.
Regards, TMS
Thank you very much to all for help, i just restarted computer and it was function.
I don't know what was the problem.
You're welcome. Thanks for the rep.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks