Solved

Editing an Excel Embedded Object in Powerpoint with VBA from Access

Posted on 2016-08-24
4
39 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

810 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