Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
45 seconds to save a file, why so long?
Why would this code:
If sSaveFolder < "Rollup" Then ActiveWorkbook.SaveAs FileName:=sSaveLoc & "\" & sSaveFolder & "\" & sBranch & "_" & sPeriod & "_Ops_Rvw_Pckg" & ".xlsm" _ , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False Else ActiveWorkbook.SaveAs FileName:=sSaveLoc & "\" & sBranch & "_" & sPeriod & "_Ops_Rvw_Pckg" & ".xlsm" _ , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False End If take 45 secs to save a .5mb file when I can manually save the same file and it only takes a couple of seconds? Is there anything I can do to speed up this process? I'm already saving to my hard drive instead of to a network location. Thanks, Keith |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
45 seconds to save a file, why so long?
I figured it out. It was because the new file had links back to the original
file, and that was requiring a lot of time to save (maybe it was calculating because of that too). But since I was going to break the links in the next line of code I just moved that line of code up above the SaveAs code, and problem solved. I did have to borrow some code from Ron de Bruin's web site (thanks a ton Ron, you rock!), because excel was bombing at first. Even though my line of code was working fine when used after the SaveAs, excel crashed when I tried to use it before saving the file. Go figure. But Ron's code did not have this problem. Just putting this out there for anyone who encounters a similar problem. Thanks, Keith "Keithlo" wrote: Why would this code: If sSaveFolder < "Rollup" Then ActiveWorkbook.SaveAs FileName:=sSaveLoc & "\" & sSaveFolder & "\" & sBranch & "_" & sPeriod & "_Ops_Rvw_Pckg" & ".xlsm" _ , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False Else ActiveWorkbook.SaveAs FileName:=sSaveLoc & "\" & sBranch & "_" & sPeriod & "_Ops_Rvw_Pckg" & ".xlsm" _ , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False End If take 45 secs to save a .5mb file when I can manually save the same file and it only takes a couple of seconds? Is there anything I can do to speed up this process? I'm already saving to my hard drive instead of to a network location. Thanks, Keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Too long to save an Excel file | Excel Programming | |||
why would a large addin save in 2 seconds or 18 seconds | Excel Programming | |||
I can't save long file names, only short one, how can I do this? | Excel Discussion (Misc queries) | |||
Long Save Times with File-Save | Excel Discussion (Misc queries) | |||
Excel file takes a long time to save | Excel Discussion (Misc queries) |