Re: Update "buildin" excel in a powerpoint with macro



Hi,

There seems to be two separate problems to solve.

Problem #1 - How do we get the macro to run at all on your Mac. It runs
without error on mine. It's possible there's a language localization problem
that Microsoft needs to solve. I think your best bet for this sort of thing
is probably to contact Microsoft support for your region.

Problem #2 - How to get the macro to run more than a single time. The macro
only ran once for me, too. So that means my code needs to be improved. Is
Steve nearby? I'll see if I can raise him.

-Jim Gordon
Mac MVP


Quoting from "Tithen90@xxxxxxxxx" <Tithen90@xxxxxxxxx>, in article
1180615546.314024.268980@xxxxxxxxxxxxxxxxxxxxxxxxxxx, on [DATE:

Hi again and thanks for helping.
I tried doing all the steps you did (started with created a new ppt
and so on) and tried to run the macro but it did not work for me. When
i started the presentation and prest the button nothing happend. So I
tried to run the macro manualy with the tool>macro>run updategraph.
And I got a window plupping up that said "Körfel nr´-2147188160
(-7FFB7DC09)'.;
OLEFormat (okänd medlem) : Ogiltig begäran. Egenskaper gäller bara för
OLE-Objekt" (live in sweden so everything is on swedish) guess that
can be translated into something as "runerror nr´-2147188160
(-7FFB7DC09)'.; Unathorized request." Then something is wrong with the
OLE-Objekt. I prest the button to find the problem and in the modul
this line "Set oGraph = oShape.OLEFormat.Object" was highligthed with
yellow.

I installed my virtual pc to try it and in the pc version of
powerpoint it seemed to work, except one thing that I wanted, it was
only possible to run the macro once then it did not work, I want it to
work infinitive times, not sure if it is possible, is it?. Hope you
can help me getting it to work on my mac, doesn't want to use the
virtual pc.

Jim Gordon MVP skrev:
Hi,

Once again you have provided excellent information, so I think I have a
potential solution for you.

This is only the germ of a possible solution and will most likely need to be
refined. It works - kind of. Steve might have jump in to help refine this.

Here's what I did so you can try to copy these steps:

* make a simple chart in an Excel workbook
* in the chart's data range I used =RAND() in each cell
* select the chart
* Edit copy
* Switch to a new empty PowerPoint presentation
* Edit Paste (to paste the chart into PowerPoint)
* Switch back to Excel and quit Excel
* Switch back to the Powerpoint presentation
* Saved the presentation so I have it in case PowerPoint crashes
* From the View menu > ToolBars > Visual Basic
* Click the Visual Basic Editor Button
* From the Editor menu choose Insert > Module
* Paste the following into the module

Sub UpdateAllGraphs()
Dim oShape As Shape
Dim oSlide As Slide
Dim oGraph As Object
' Loop through each slide in the presentation.
For Each oSlide In ActivePresentation.Slides
' Loop through all the shapes on the current slide.
For Each oShape In oSlide.Shapes
' Found a graph; obtain object reference, and
' then update.
Set oGraph = oShape.OLEFormat.Object
oGraph.Application.update
Next oShape
Next oSlide
End Sub

* Press Apple+Q on the keyboard to exit the VB Editor and return to the
slide editor
* From the SlideShow menu choose Action Buttons > Custom
* Drag the cursor diagonally on the slide to create a button
* When you let go choose "Run Macro" UpdateAllGraphs then click OK
* Run the slide presentation
* Click the action button

PowerPoint will look like it went back to edit mode and in a moment present
a "wait" cursor. The graph will update with new data. Move the mouse and
you'll see the cursor return to normal. Click on the slide and the show will
resume.

The Macro is based upon this Microsoft article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q222689

If you got any red text when you pasted the macro code then extra characters
crept in. Position the cursor in front of the black text then press the
delete key to get rid of anything in between, then press enter to make the
next line of code again.

Any line that begins with a single quotation mark does not get processed and
is there for your information.

I hope the VB Editor wasn't too scary for you. There's a lot there to
investigate.

-Jim Gordon
Mac MVP


Quoting from "Tithen90@xxxxxxxxx" <Tithen90@xxxxxxxxx>, in article
1180528992.300710.64190@xxxxxxxxxxxxxxxxxxxxxxxxxxx, on [DATE:

On 30 Maj, 05:15, Jim Gordon MVP <goldke...@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
Hi,

Thanks for the reply. That is helpful.

In the setup you are using the Excel data source workbook exists somewhere
as file. When you double-click the embedded graph object Excel should open
and you can then edit the data directly.

I want to be sure I reproduce the setup exactly as you have done it.

Does the data range for the chart exist on the same work*** as the chart
in Excel, or is the graph on a chart work***?

Am I correct that what we need to do is to tell Excel to "calculate" on
demand which will result in new values for the data set, which presumably
has the RANDOM cell function in the cells? And then we need to refresh the
chart so that it reflects the new values but without going to the trouble
of
opening Excel to work on the embedded chart? You want to click a button
perhaps and just have the data refresh? Or maybe mouse-over something on
the
slide to trigger the update?

If I have it right, please post back. If I have it wrong please post
corrections.

It is not the same as Insert > Object > Excel chart. If you were to Insert

Object > Excel chart the Excel data source would exist inside the
PowerPoint
presentation file as an embedded object. Some of the behavior is the same
as
your setup, but in this case there is no .xls file anywhere else on your
computer

Thanks.

-Jim Gordon
Mac MVP

Quoting from "Tithe...@xxxxxxxxx" <Tithe...@xxxxxxxxx>, in article
1180472766.382304.20...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <goldke...@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
Hi,

There is at least 4 possible ways you could have created linked charts.
Please let us know which method you followed:

* Link to data that's contained in an excel workboook already saved as a
file somewhere
* Insert > Object > Microsoft Excel Workbook
* Insert > Object > Microsoft Excel Chart
* Insert > Object > Microsoft Graph Chart

Each of the above methods will behave differently, but all of them can
produce charts that are linked to a data table and can be refreshed.

Thanks.

-Jim Gordon
Mac MVP

Quoting from "Tithe...@xxxxxxxxx" <Tithe...@xxxxxxxxx>, in article
1180295035.655949.82...@xxxxxxxxxxxxxxxxxxxxxxxxxxx, on [DATE:

Hello
I got a huge problem that I hope you people can help me solve. I am
trying to create a powerpoint with my mac (version 2004 of ppt) and I
got some excel charts that generates random numbers and calculates
abit in my powerpoint and when watching the powerpoint I want the
watcher to have the ability to "refresh" the excel charts to get new
random numbers but I have no idea how to do this. I thougt about doing
a macro but I lack the skills to create it so I wonder if somone could
help me with this.

/ Tithe...@xxxxxxxxx

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP infohttp://mvp.support.microsoft.com/

I hope you can help me.

I did the following:
insert -> object ->then chosed from file then selected a file and
prest ok
Guess that is the same as:
insert->object->excel chart

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP infohttp://mvp.support.microsoft.com/

Hi again!

First I belive the excel chart I got in my presentation does not exist
anywhere else on the computer (at least not visible), because I can
remove the files I imported too the powerpoint without any problems,
and the presentation works just like before. So I belive it is a excel
chart embedded in my presentation.

And yes, the only thing we need to do is to force the excel charts in
the presentation to update so it generates new random numbers, without
leaving the presentation or opening the excel charts. And I want a
button to press so it updates.

I hope I answerd all the questions you had, if not tell me what I
missed.


--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info http://mvp.support.microsoft.com/


--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info http://mvp.support.microsoft.com/

.


Loading