I have a procedure which will open a template and save as with a particular naming convention. During testing it was working well with a test template.
Now switched the template it is opening to the live one, it gets to the activeWorkbook.SaveAs code and sits on the timer I have tried waiting it out but noticed...
If I end the procedure the save as actually completes.
I've tried things like making sure calculations are turned off in the template and that the on exit macro checks are fine. I can't figure it out.
Any help figuring out what the delay may be would be great, I need it to get pass this stage to complete the rest of the procedure.
Cheers,
Lisa
Last edited by lisa_jd; 11-19-2010 at 05:00 AM.
We need to see the actual code and/or the workbook
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
This is where it gets stuck. Unfortunately I can't put the workbook up. Will see if i can take some content out of the template and post that. i am thinking along the line of its something in the template or other set ups. Its not the code as works fine with a blank worksheet.
Sub TimesheetDeploy2() 'Written by Lisa Davidson, NQBP Commercial Contracts and Projects Coordinator 'Save As Dim PathStr As String Dim SaveStr As String Dim NameStr As String Dim DateStr As String NameStr = "Timesheet_" & ActiveSheet.Range("D4").Value DateStr = Format(ActiveSheet.Range("D6").Value, "yymmdd") PathStr = "PathName" SaveStr = PathStr & NameStr & "_" & DateStr FileExtStr = ".xls" With ActiveWorkbook .SaveAs SaveStr & FileExtStr .Close SaveChanges:=False On Error Resume Next End With 'Open Timesheet Again Workbooks.Open TimesheetPath & TimesheetName 'Go Back to Employee Summary.xls Workbooks(EmpSum1).Activate ActiveCell.Offset(1, 0).Select End Sub
is there something to force it to action?
If the code runs fine with a blank sheet, then we'd need to see the workbook I suspect.
Is this code in the workbook that is active at the time (i.e. the one you are saving and closing?)
I have figured out what it is but need to know how to overcome.
In the template file, I have a before save procedure. If this is not in the template file i don't have the problem when I try to run the Save As procedure (which is in another file).
What's this
PathStr = "PathName"
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
If you don't want the BeforeSave procedure to run, then use:
before the code that saves the file, then set it back to True afterwards.Application.EnableEvents = False
Thats were there is a long winded path name that I thought i'd do you the favour of not having to read.
i have run a few more test the problem is the automated before save macro in the template. I changed the location of the to before close. It saves then obviously stops on the:
.Close SaveChanges:=False
I need the template to have this macros active is there another close code that would close that would overwrite the before close macro?
I think a workbook would help
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Oh thank you so much it works!!! Your are a star, this has been bugging me for the last few hours!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks