powerpoint-vba

PowerPoint VBA - Copy shape to a slide

余生长醉 提交于 2019-12-30 13:57:11
问题 I have developed a Powerpoint VBA function to which I pass a Shape and Slide object. The function finds for a shape with text LOGO inside it, if it finds, it replaces that shape with the shape I passed to the function. Function works perfectly on office 2013 but not on Office 2016. Can anybody please suggest a work around for this? Public Sub AddLogo_ONE(shLogo As Shape, oSlide As PowerPoint.Slide) Dim sh As Shape For Each sh In oSlide.Shapes If sh.HasTextFrame Then If UCase(sh.TextFrame2

How to dynamically reference PowerPoint slides using VBA

梦想与她 提交于 2019-12-25 08:34:15
问题 I've written/compiled a macro that opens an Excel file, creates a PowerPoint chart and populates the chart worksheet with data from a worksheet in the Excel file. I'm trying to alter the macro to loop through the Excel file's worksheets and: for each worksheet create a PowerPoint slide and chart populate the PowerPoint chart with data from the worksheet in the Excel file Presently when I run the macro, the first PowerPoint chart and slide is created correctly. The second slide is created for

Interactive Quiz using ppt

一曲冷凌霜 提交于 2019-12-25 07:01:31
问题 I posted a rubbish question about this before and have gone away and done some work on it to re-ask. Basically I've made a ppt quiz that counts how many correct and incorrect answers a person has given. It then feeds this information back to the user at the end. However what I want to happen now is I want the results to be stored so that I can go back in and see how each user has performed in the quiz. Ideally I would like it to work over 6 networked computers storing all the quiz results in

How to Copy/Paste text box from MS Word to Powerpoint slide?

最后都变了- 提交于 2019-12-25 06:22:00
问题 I am currently creating a document that will take the format and text from a MS Word document and paste it into a text box in a PowerPoint template. I have looked all over to see how this can be done and haven't found much. Any help would be much appreciated!! Public Sub CommandButton1_Click() Dim pptApp As Object Dim pptPres As String Dim folderPath, file As String folderPath = ActiveDocument.Path & Application.PathSeparator file = "Huntington_Template.pptx" pptApp.Visible = True pptApp

Create animated random image display tool in VBA

风格不统一 提交于 2019-12-25 06:14:11
问题 I have a PowerPoint slide with different images. I need to create VBA code in PowerPoint that recognises all these images and fades them out one by one - except for one randomly chosen image. This last image should remain until the end, then fade out and display in the middle of the slide. I have an idea of how to do it and have experience with object oriented languages (R) but I have never used VBA before. Therefore I would be grateful for pointers on how to do any of the following in VBA:

PowerPoint Shapes.AddOLEObject Throws Error HRESULT E_FAIL

末鹿安然 提交于 2019-12-25 03:22:03
问题 Following the guidelines from this link, I've wrapped a user control as an ActiveX component. Build the code successfully, and I can confirm that the COM component is registered in Windows registry. Class name mentioned in registry is "MyChartsControl.UserControl1". After that I try to add my ActiveX Wrapped user control in PowerPoint Slide object using following code: powerpointSlideObject.Shapes.AddOLEObject(100, 100, 111, 222, ClassName:="MeridiaChartsControl.UserControl1") OR using the

Extract excel graph to powerpoint template

北慕城南 提交于 2019-12-24 21:28:43
问题 I have an Excel sheet in which I can select a city (100 different ones) and then a graph will be generated for that city. I would like to create a PPT with 100 different slides, one for each city. For these slides I have a template, so what I would like to achieve is: - Loop through all 100 cities - Copy the generated graph and paste as image at a specified location and size in the PPT slide Does anyone have an idea on how to do this with either VBA or Python? Many thanks! 回答1: To copy and

How to add new(customized) Theme colors to Powerpoint using VBA

ぃ、小莉子 提交于 2019-12-24 18:18:42
问题 Can anybody please help me with adding new(customized) theme colors to a ppt presentation. By Theme colors I mean, the color pallette that shows up in the little popup when we click on Shape Fill , Shape Outline buttons in PPT. Thanks in advance, Sri. 回答1: Echo Swinford has a tutorial on adding colors manually and a link to an add-in that does the job. http://echosvoice.com/tutorials-2/2010-2/powerpoint-2010-custom-colors/ It involves modifying one of the XML files that make up a PPTX/etc.

VBA Macro to Copy Range and Paste range to PPT as Picture

折月煮酒 提交于 2019-12-24 18:09:56
问题 Need help to copy range of cells from excel sheet1 to PowerPoint file and paste it as Picture and make that picture fit inside the slide automatically. I currently use Snagit software to take screenshot of the sheet and use send to powerpoint but it take lots of time. Any feedback would be nice to automate this process 回答1: something like this Sub BetterPicturePaste() '...other stuff... Windows(1).Sheets(1).Range("myrange").Copy Windows(2).View.PasteSpecial DataType:=ppPasteEnhancedMetafile

How to update a chart?

匆匆过客 提交于 2019-12-24 13:49:42
问题 I have a PowerPoint presentation with ~200 slides. Each slide has one chart, with data that is updated monthly by a link to a master xlsx file. To not show empty values (future months) in the charts, I open the data editor (chart right click > Edit data...) of every chart and select the range until the current month. I wrote a macro for it in PowerPoint: Sub Refresh_slides() For i = 1 To ActivePresentation.Slides.Count Set ObjSlide = ActivePresentation.Slides(i) On Error Resume Next Set