PC Review


Reply
Thread Tools Rate Thread

45 seconds to save a file, why so long?

 
 
Keithlo
Guest
Posts: n/a
 
      8th Dec 2009
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 With Quote
 
 
 
 
Keithlo
Guest
Posts: n/a
 
      11th Dec 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Too long to save an Excel file sk005 Microsoft Excel Programming 7 21st Jul 2009 10:12 AM
why would a large addin save in 2 seconds or 18 seconds bmurphy@xlrotor.com Microsoft Excel Programming 7 12th Feb 2008 05:15 AM
Why Can't I Save Long File Names? John Schutkeker Windows XP Help 4 17th Aug 2007 12:30 PM
Long Save Times with File->Save BrianDavid Microsoft Excel Misc 3 20th Dec 2005 03:57 PM
Why does my machine take so long to save a file? Tim Zych Microsoft Windows 2000 4 23rd Aug 2004 12:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:28 PM.