Solved

Editing an Excel Embedded Object in Powerpoint with VBA from Access

Posted on 2016-08-24
4
46 Views
Last Modified: 2016-09-26
I have a whole process that updates various objects in Powerpoint using data and an Access module.

I have successfully updated chart data, text boxes and tables. The issue lies with an embedded Excel spreadsheet. I need to update the data in the Excel embedded spreadsheet but for some reason it is not updating the data.

The portion of my code that is supposed to update the Excel is this...
                    With currentSlide.Shapes(strObj).OLEFormat.Object
                       .Activate
                       .Worksheets(1).Range("J11").Value = "50"

It doesn't error out but it does not actually update the cell value (previously in the code the PowerPoint file is opened and moved to the correct slide (currentSlide is the variable that references this and strObj is the variable that is feeding in the name of the object to be updated). It works well every where else that I am updating something.

Do I have to use something other than activate? Is there an update method or something that I have to use?

Any help would be greatly appreciate.
0
Comment
Question by:Margaret Castellanos
  • 2
4 Comments
 
LVL 19

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 500 total points
ID: 41770306
I believe the range reference may be wrong.  What is the cell address you are trying to update?

you can also reference a cell with
.cells(nRow, nCol)

Open in new window

I(t would be helpful is you post the rest of the procedure, thanks
0
 

Accepted Solution

by:
Margaret Castellanos earned 0 total points
ID: 41770448
Thanks Crystal -- actually it is a range and that is the correct formatting for a range (col, row). You are correct if it was a cell it would then be (row, col).

I was able to get the code to work exactly as written. There was a hidden worksheet and the code was updating the hidden worksheet which would be 1 -- once I pointed it the correct worksheet it worked beautifully.

:D
0
 
LVL 19
ID: 41770548
> "a hidden worksheet"

aah! Glad you figured that you. I generally use Worksheets("SheetName") as opposed to number referencing so it is clear which sheet it is ;) ~

btw, the J didn't look like a J with the screen font ... looked more like a weird bracket ... now I see the range reference is just fine
0
 
LVL 14

Expert Comment

by:frankhelk
ID: 41815701
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Split:
-- Margaret Castellanos (https:#a41770448)
-- crystal (strive4peace) - Microsoft MVP Access (https:#a41770306)


If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

frankhelk
Experts-Exchange Cleanup Volunteer
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question