Enabling macros in chart data sources in Powerpoint - excel

I have a Powerpoint file with many charts that I expect many different users to use with their own data. I'm trying to make this Powerpoint as easy to use as possible by writing VBA into each data source (by data source, I mean the default Excel sheet that is embedded in Powerpoint when you select "Insert" > "Chart"). My goal is to allow them to click the chart, select "Edit data," paste info from a PivotTable into the Excel window that pops up, and let the macro does the rest. The code I can write myself, but I have a different problem:
I've tried writing macros in these embedded Excel files but they do not save once they are closed (I assume they must be .xls or similar and not .xlsm). How can I get these macros to save? I've tried drag and dropping .xlsm files into Powerpoint, but it shows the actual charts on the slide and it's difficult to work with. I'd like the Excel files to be hidden from Powerpoint view and easily accessed using the "Edit data" option.
I hope this description makes sense, if not I can explain further / answer any questions.
Thanks!

Can't you just provide PowerPoint charts, and have them paste data into each chart's DataSheet in PowerPoint?

Of late, PPT does its best to convert pasted charts into PowerPoint charts (same basic engine as Excel charts but they're not Excel objects). You can get round this if you copy the chart from XL, switch to PPT and on the Home tab, click the downward pointing arrow below Paste, pick Paste Special and choose to paste as embedded Excel chart object.
You can then doubleclick the pasted object and Excel will launch for in-place editing.
Or you can right-click, choose "Macro enabled worksheet object" or whatever, and then opt to Open or Edit. Edit gives you in-place editing within the PPT window, Open launches the embedded data in a full copy of Excel.

Related

How to inject excel data to embed powerpoint chart with VBA

I want to know how we can inject excel data into embed powerpoint chart.
Any information that I search taught me how to do it, but with create new presentation. I need to update the existing chart from powerpoint using data from excel.
And the method should not be update link or something. Because I deal with more than hundred charts, I'm afraid linked method will take huge resource that cannot handle by my device. The other reason is I need to keep the chart editable in powerpoint (something that cannot done with paste link method).
Any suggestion?
Thanks
it depends of the version of you office. I have 2016 office, so it is very simple to do
these are the steps
Go to INSERT and lok for "Tables", then the opcion called (excel)
An excel view is going to open, then in the sheets you can inser your information, make a table format also
In the excel view the go to Insert, Recommended graphics and select the one you want
here some photos
step 1
excel view

Interactive Excel worksheet in PowerPoint

I'm wondering if there is a solution to add an interactive Excel worksheet into a PowerPoint slide. The idea would be to explain a model without having to move to Excel. The table would not have to update or save, just present the current data. It could even be pasted in.
It might look like:
You can embed an Excel object into a PowerPoint slide and edit the Excel cells in PowerPoint when designing the slide, but not when running the presentation.
An open Excel file is just one Alt-Tab away. Why make things more complicated than they need to be.
Insert the Excel document as an object:
Insert | Object | Create From File and browse to the file you want to insert.
While it's selected, give it an Action Setting:
Insert | Links | Action
In the dialog box that appears, choose Object Action: Open or Edit
Try both, see which suits your PPT version and tastes best. Here, either one opens the document in Excel atop the presentation window; no need to bounce out and open Excel or make sure it's open first.

VBA Excel Chart to powerpoint - saving file as multiple outputs

I have a template in excel, and a powerpoint template.
in the powerpoint template I have several charts linked to the excel template.
I want to make a loop that changes something in excel, so that the chart updates, "saveas" for both the excel and powerpoint file, so I have eg. 100 different excel files and 100 different powerpoint files, all build on the templates. I want to be able to manually alter some data in those 100 excelfiles, with the link to powerpoint still intact, so they are updated too if needed.
however, when I open the powerpoint templates, right click on a chart and select "edit data", then the chart is still linked to the excel template, not the saveas version of the excel file?
how do I change the link of a chart in powerpoint, to a different excel filename? the structure in the two excel files are identical.
the chart is created in excel and copy/pasted as "keep source formatting and chain data" (translated from danish)
any help would be greatly appreciated.
I have also tried a solution where the copy/paste is done via vba into an empty powerpoint template, but that is more time consuming, and powerpoint often crashes.
Assuming you have a reference to the shape represented by the linked chart in oSh, this will show you the link:
Debug.Print oSh.LinkFormat.SourceFullName
And this will change it to some other file:
oSh.LinkFormat.SourceFullName = "c:\some\path\yourfile.xls"
Most likely there will also be a !chartname or the like after yourfile.xls ... you'll need to include that.
And save the Excel files first, THEN change the link in the PPT to point to them. If you change the link to point to a non-existent file, PPT won't throw any errors; it'll simply leave the link unchanged.

Embed spreadsheet in a powerpoint in sharepoint

I want to embed specific cells from a spreadsheet in a powerpoint presentation. I have seen this done before with macros (I think), but I have never done it myself. I have done a little googling and am coming up with 50 solutions. Can someone help me narrow it down.
The big gotcha here is that both of these files will be in one folder in a document library in a sharepoint site. The other gotcha, which is kind of a given, is that I want the ppt to update to latest excel data when it is opened.
This is much simpler than I thought. Here is the answer for anyone else who is attempting this:
Make sure the files are in their final folders you want them in
Open the files
Select the Cells you want to display in the ppt - Ctrl - C to copy
Edit -> Paste Special in the ppt slide you want the cells to display on
Paste as a MS Excel Worksheet Object AND select the "As a Link" checkbox on the left
Size it however you want
Save the ppt
Each time you open the ppt you select "update links" and the ppt gets the latest data from the xls
The sharepoint part is no big deal, it appears to just work like it would if the files were local
These instructions are for Office 2003, they are likely similiar for other officer versions.

Use VBA to copy an image from headers/footers of one sheet to another

I need to write a VBA code to copy a company logo in the headers/footers of one excel sheet to another sheet in another workbook. Any ideas?
Excel has a handy Record Macro function.
You can initiate that, Copy the footer over, then stop the recording.
Then, review the code, and it should pretty much show you how to do it.
If you are working in anything older than Excel 2007 then it doesn't sound like this is possible without using the original graphic file (e.g. JPG, GIF etc):
Normally, you can copy and paste the
headers and footers from one worksheet
to another by selecting the worksheets
and then using the Header or Footer
dialog boxes (click Custom Header or
Custom Footer on the Header/Footer tab
of the Page Setup dialog box).
However, if the original headers and
footers contain graphics, the graphics
will not propagate to the other
worksheets. The only way to work with
pictures in headers or footers for
multiple worksheets is to select all
the worksheets, and then insert a
graphic by using the Insert Picture
dialog box (click the Insert Picture
button), or format the graphic by
using the Format Picture dialog box
(click the Format Picture button). The
original graphic file is needed for
this procedure.
source
It may be possible in Excel 2007 - see here
One workaround is to copy the original worksheet to the new workbook:
' macro on the source workbook
Sheets("Sheet1").Move After:=Workbooks("Book2").Sheets(3)
When you do this, you get a worksheet in the destination workbook with all the features of the original, including footers and headers, you can then copy all the content you want into the new worksheet

Resources