Update "buildin" excel in a powerpoint with macro

T

Tithen90

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.

/ (e-mail address removed)
 
J

Jim Gordon MVP

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

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.

/ (e-mail address removed)

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
T

Tithen90

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




--
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
 
J

Jim Gordon MVP

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 worksheet as the chart
in Excel, or is the graph on a chart worksheet?

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




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 info
 
T

Tithen90

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 worksheet as the chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:


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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.
/ (e-mail address removed)
--
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.
 
J

Jim Gordon MVP

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


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 worksheet as the chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:


On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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.

-Jim Gordon
Mac MVP
Quoting from "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.
/ (e-mail address removed)
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
 
T

Tithen90

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 tobe
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


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 worksheet as the chart
in Excel, or is the graph on a chart worksheet?

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 refreshthe
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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) andI
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.

/ (e-mail address removed)

--
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
 
J

Jim Gordon MVP

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


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


On 30 Maj, 05:15, Jim Gordon MVP <[email protected]>
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 worksheet as the chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.

/ (e-mail address removed)

--
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

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
B

Bill Dilworth

I am not really a Mac person, but from the Windows side of things I might be
able to offer some assistance until Steve returns.

The code does not check what the type of shape is before it assumes it is a
graph. You may want to check to see if the oShape.Type is
msoEmbeddedOLEObject before processing it as one. As it sits, it will only
work on presentations that contain ONLY embedded OLE objects

Alternately, you can just add an On Error Resume Next command to skip over
that which does not execute.


Bill D.



Jim Gordon MVP said:
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


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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:

On 30 Maj, 05:15, Jim Gordon MVP <[email protected]>
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 worksheet as the
chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.

/ (e-mail address removed)

--
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

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
J

Jim Gordon MVP

Hi Bill,

When I added the error handler the routine still only worked once. You
should be able to repeatedly update the chart with new data.

-Jim Gordon
Mac MVP


I am not really a Mac person, but from the Windows side of things I might be
able to offer some assistance until Steve returns.

The code does not check what the type of shape is before it assumes it is a
graph. You may want to check to see if the oShape.Type is
msoEmbeddedOLEObject before processing it as one. As it sits, it will only
work on presentations that contain ONLY embedded OLE objects

Alternately, you can just add an On Error Resume Next command to skip over
that which does not execute.


Bill D.



Jim Gordon MVP said:
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


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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:

On 30 Maj, 05:15, Jim Gordon MVP <[email protected]>
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 worksheet as the
chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.

/ (e-mail address removed)

--
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

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
B

Bill Dilworth

Try this:

'---------
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.
If oShape.Type = msoEmbeddedOLEObject Then
Set oGraph = oShape.OLEFormat.Object
oGraph.Application.CalculateFull
End If

Next oShape
Next oSlide
End Sub
'---------

Bill Dilworth


Jim Gordon MVP said:
Hi Bill,

When I added the error handler the routine still only worked once. You
should be able to repeatedly update the chart with new data.

-Jim Gordon
Mac MVP


I am not really a Mac person, but from the Windows side of things I might
be
able to offer some assistance until Steve returns.

The code does not check what the type of shape is before it assumes it is
a
graph. You may want to check to see if the oShape.Type is
msoEmbeddedOLEObject before processing it as one. As it sits, it will
only
work on presentations that contain ONLY embedded OLE objects

Alternately, you can just add an On Error Resume Next command to skip
over
that which does not execute.


Bill D.



Jim Gordon MVP said:
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:

On 30 Maj, 05:15, Jim Gordon MVP <[email protected]>
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 worksheet as the
chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.

/ (e-mail address removed)

--
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


--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
J

Jim Gordon MVP

Hi Bill,

No luck. It runs fine the first attempt but on the second attempt the graph
doesn't get refreshed.

I added DoEvents but that didn't help either. I wonder if we have to call
the object by its name and just update the specific object.

-Jim Gordon
Mac MVP


Try this:

'---------
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.
If oShape.Type = msoEmbeddedOLEObject Then
Set oGraph = oShape.OLEFormat.Object
oGraph.Application.CalculateFull
End If

Next oShape
Next oSlide
End Sub
'---------

Bill Dilworth


Jim Gordon MVP said:
Hi Bill,

When I added the error handler the routine still only worked once. You
should be able to repeatedly update the chart with new data.

-Jim Gordon
Mac MVP


I am not really a Mac person, but from the Windows side of things I might
be
able to offer some assistance until Steve returns.

The code does not check what the type of shape is before it assumes it is
a
graph. You may want to check to see if the oShape.Type is
msoEmbeddedOLEObject before processing it as one. As it sits, it will
only
work on presentations that contain ONLY embedded OLE objects

Alternately, you can just add an On Error Resume Next command to skip
over
that which does not execute.


Bill D.



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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:

On 30 Maj, 05:15, Jim Gordon MVP <[email protected]>
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 worksheet as the
chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.

/ (e-mail address removed)

--
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


--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
S

Steve Rindsberg

No luck. It runs fine the first attempt but on the second attempt the graph
doesn't get refreshed.

Doesn't get refreshed, or the code doesn't run at all.

What I'm seeing here in 2004:

Runs the first time the "Click here" rectangle is clicked (and the cursor turns
into a "Links here" type of hand). But the chart doesn't appear to update.

Thereafter the cursor becomes a normal arrow, even over the "Click here"
rectangle. PPT doesn't see it as a link. IOW, it doesn't seem to be that
there's a problem with the code the second time around, but rather that PPT
won't RUN the code a second time.

And in fact it doesn't run the code a second time (verified by putting
debug.print statements into the code ... they only run once).

In PPT 2001 it works fine.

I also notice that in 2004, I get the "Converting Metafile" messagebox when
opening this file. I don't get that in 2001. FWIW.

<rant>
Personally, I think 2004's VBA implementation is flawed in subtle ways. I've
had nothing but trouble from it on one project, to the point where I'm
developing in 2001; so long as I compile the code there, it runs fine in 2004.
Developing in 2004, though, has been a total waste of time.

Perhaps it's MS' kinder, gentler way of preparing us for 2008. Instead of
ripping VBA out altogether in one go, they're removing it bit by bit? Letting
us gradually become accustomed to code that doesn't work? ;-)
</rant>


I added DoEvents but that didn't help either. I wonder if we have to call
the object by its name and just update the specific object.

-Jim Gordon
Mac MVP

Try this:

'---------
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.
If oShape.Type = msoEmbeddedOLEObject Then
Set oGraph = oShape.OLEFormat.Object
oGraph.Application.CalculateFull
End If

Next oShape
Next oSlide
End Sub
'---------

Bill Dilworth


Jim Gordon MVP said:
Hi Bill,

When I added the error handler the routine still only worked once. You
should be able to repeatedly update the chart with new data.

-Jim Gordon
Mac MVP


Quoting from "Bill Dilworth" <[email protected]>, in article
#3G3#[email protected], on [DATE:

I am not really a Mac person, but from the Windows side of things I might
be
able to offer some assistance until Steve returns.

The code does not check what the type of shape is before it assumes it is
a
graph. You may want to check to see if the oShape.Type is
msoEmbeddedOLEObject before processing it as one. As it sits, it will
only
work on presentations that contain ONLY embedded OLE objects

Alternately, you can just add an On Error Resume Next command to skip
over
that which does not execute.


Bill D.



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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:

On 30 Maj, 05:15, Jim Gordon MVP <[email protected]>
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 worksheet as the
chart
in Excel, or is the graph on a chart worksheet?

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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), on [DATE:



On 28 Maj, 18:27, Jim Gordon MVP <[email protected]>
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 "(e-mail address removed)" <[email protected]>, in article
(e-mail address removed), 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.

/ (e-mail address removed)

--
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


--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info




--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info

================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
J

Jim Gordon MVP

You read my mind


<rant>
Personally, I think 2004's VBA implementation is flawed in subtle ways. I've
had nothing but trouble from it on one project, to the point where I'm
developing in 2001; so long as I compile the code there, it runs fine in 2004.
Developing in 2004, though, has been a total waste of time.

Perhaps it's MS' kinder, gentler way of preparing us for 2008. Instead of
ripping VBA out altogether in one go, they're removing it bit by bit? Letting
us gradually become accustomed to code that doesn't work? ;-)
</rant>

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
S

Steve Rindsberg

Jim Gordon MVP said:
You read my mind

Speaking of which ... and then veering off wildly on a tangent ...

I forgot to mention that I'm with you in wanting to see Real Basic supported in
the next release of PPT as well as current releases.



================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top