ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save takes seconds vs. SaveAs/Save As takes minutes (https://www.excelbanter.com/excel-programming/307237-save-takes-seconds-vs-saveas-save-takes-minutes.html)

Andrew H[_3_]

Save takes seconds vs. SaveAs/Save As takes minutes
 
Hi folks,
Looked for my problem in the discussion, and found only one similar
post (back in 2001) that hadn't been answered. My apologies if this
has been addressed before, but I've been spinning my wheels for a
couple days and have gotten nowhere.

My situation is that 1) I'm still a relative novice with VB and 2) I'm
updating an rather large excel file with lots of background VB going
on.
There are many user defined functions UDFs, but one in particular
seems to be causing problems with Save As. This function is

Function ConsecutiveCFEAbove(level As Single, r As Range) As Integer
This function loops through the cells in "r" looking for cells above
"level".
This function is called from only two cells in the spreadsheet.

The entire book takes only a couple seconds to do a full recalculate,
and simply saving the file is likewise very fast. However, a Save As
launches into a lengthy (ie, 2-3 minutes) recalculation. Even
stranger, the UDF above is called over 200 times. For comparison, the
F9 recalculate calls it only twice (once for each of the two cells
that use it).

Does anyone have any thoughts on this? (I didn't provide too many
details about the spreadsheet, thinking that'd be too much
information, so I hope that someone has experienced something
similar...)

Thanks in advance,
Andrew H.


All times are GMT +1. The time now is 10:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com