Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Too long to save an Excel file sk005 Excel Programming 8 July 21st 09 10:12 AM
why would a large addin save in 2 seconds or 18 seconds [email protected] Excel Programming 7 February 12th 08 05:15 AM
I can't save long file names, only short one, how can I do this? short file names Excel Discussion (Misc queries) 0 January 3rd 06 05:13 PM
Long Save Times with File-Save BrianDavid Excel Discussion (Misc queries) 3 December 20th 05 03:57 PM
Excel file takes a long time to save ben@bikecenturies Excel Discussion (Misc queries) 1 February 3rd 05 12:27 AM


All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"