Rabu, 16 Oktober 2019

[smf_addin] Digest Number 4628

3 Messages

Digest #4628

Messages

Tue Oct 15, 2019 12:51 pm (PDT) . Posted by:

a.bereziuk

Hello Randy,


I use my own macro to copy some cells

and turn automatic calculation off during the macro's run:


***

Application.Calculation = xlManual 'set manual calculation
Range("D2").Copy Range("D10")
...

Application.Calculation = xlAutomatic 'set automatic calculation

***


but SMF plugin still starts recalculation and Excel hangs for 2-3 sec. Is it possible to turn the recalculation off during the macro?


Tue Oct 15, 2019 1:16 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Sorry, not a clue. That sounds like it should work.

Could the very act of copying force a recalculation on the formula that was
copied, in the new cell only?

Or, when you turn automatic calculation back on, would it force a
recalculation?

Depending on the formula, "recalculation" can just mean re-extraction of
the data from a saved copy of a web page, not retrieving a new copy of the
web page. That should only take 2-3 seconds if you are retrieving large web
pages.

On Tue, Oct 15, 2019 at 12:56 PM a.bereziuk@... wrote:

>
> I use my own macro to copy some cells
> and turn automatic calculation off during the macro's run:
>
> ***
> Application.Calculation = xlManual 'set manual calculation
> Range("D2").Copy Range("D10")
> ...
> Application.Calculation = xlAutomatic 'set automatic calculation
> ***
>
> but SMF plugin still starts recalculation and Excel hangs for 2-3 sec. Is
> it possible to turn the recalculation off during the macro?
>
>
>

Wed Oct 16, 2019 3:29 am (PDT) . Posted by:

a.bereziuk

> Could the very act of copying force a recalculation on the formula that was copied, in the new cell only?


Yes, it could be. I copy cells with formulas like: "=A1-B1" to another row, e.g. as "=A2-B2". So that the row number is adjusted automatically. May be this internal "automation" switches the automatic calculation prematurely and triggers the addin recalculation.



> Or, when you turn automatic calculation back on, would it force a recalculation?


Earlier, as I entered formulas into the cells directly from VBA in the macro code, it was not so. Although I switched automatic calculation off in the beginning and on in the end of the macro like now. But with the time the formulas became more complex, so I started to use a template with the ready formulas in the workbook to copy them to the appropriate cells.



>Depending on the formula, "recalculation" can just mean re-extraction of the data from a saved copy of a web >page, not retrieving a new copy of the web page. That should only take 2-3 seconds if you are retrieving >large web pages.


I use smfGetYahooPortfolioView as an array and RCHGetTableCell on another sheet separately for european stocks in EUR.

For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar