View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 292
Default Camera tool is slowing macro

Hi

Temporarily removing the link (or better, inserting the link only when you
need it and removing it again afterwards) usually helps:

Sub Test()
Dim S As String
S = Sheets(2).Pictures(1).Formula
Sheets(2).Pictures(1).Formula = ""
'your code here
Sheets(2).Pictures(1).Formula = S
End Sub

HTH. Best wishes Harald

"Yokie Cahyadi" skrev i melding
...
Yes, I have linked pictures using the camera tool. I made a testing to
prove
that the camera tool is slowing down the macro (or CPU as you said). I
compared the processing time before and after the linked pictures existed
as
follows.
- Open a workbook that contains a macro (any macro will do). Run the macro
and observe the processing time;
- Open a second new workbook and use the camera tool to create couple or
more linked pictures;
- With the 2nd workbook still opens, run the same macro above and notice
that it takes longer time to run it now. The difference will be more
noticeable as you increase the numbers of linked pictures.

Is there a workaround to this issue?

Thanks again.
============


"NickHK" wrote:

I would imagine it is because you now have linked pictures that have to
continually update when the data is changed.
The updating is a background operation, but obviously takes time/CPU
cycle
to execute, giving less to your macros.

NickHK

"Yokie Cahyadi" <Yokie wrote in
message
...
Is this a known issue or bug? I have a file that contains simple macros
to
automate repetitive tasks. The macro works fine and very fast until
this
month. I added one tab to show few charts which were created using the

camera
tool. Strange but true, the same macro now runs very slow and takes a
considerable time to complete. I'm very sure that the problem is not
the

way
I wrote the macros (if I deleted the new tab, my macro would run very
fast

as
usual). Note that my macros do not refer to the charts and vice versa.
I
believe if you have a worksheet/workbook with charts created using the

camera
tool, they will slow your macros.

Please let me know how I can use the camera tool and at the same time,
I

can
run my macro smoothly and fast.

Thanks in advance.