powerpoint-vba

How to resolve Missing Powerpoint 15 Object Library Error

僤鯓⒐⒋嵵緔 提交于 2019-12-24 12:44:03
问题 I have written a macro that exports from excel to powerpoint and have gotten it to work properly in Excel/Powerpoint 2013, 2010. However I tested it on another version of Excel 2010 and got a VBA error that it was missing powerpoint object library 15. I tried running the macro with powerpoint library 14 and was able to but it wasn't reformatting the slides or doing a lot of the formatting that I was doing. What is the best way/easiest way to install an object library. Can I browse and import

Finding the VBIDE.Reference.Name of object libraries vba

為{幸葍}努か 提交于 2019-12-24 09:48:21
问题 I've found how to add a reference programmatically with VBA, This explains how to add object references programmatically using the name of the Library, with the example "VBScript_RefExp_55". My question is how do I find this reference name to use in this code for different object libraries? Such as the PowerPoint Library for example? 回答1: I use this to get the info on my references : Private Sub ListProjectReferencesList() Dim i As Long Dim VBProj As Object 'VBIDE.VBProject Dim VBComp As

Office 2016/365 VBA fails to update PPT links from old script

爱⌒轻易说出口 提交于 2019-12-24 08:22:46
问题 I have a need to change lists of links in large PPT presentations. I had working code that did it fine. Recently I upgraded to Office 2016 and now the script is not working correctly. I simple put my old and new path strings in a 2 dimensional array and loop through them correcting the links in the PPT. This has some debug code in it, and come commented lines where I was trying things to fix it, please ignore. For j = 0 To UBound(MyArray) oldString = MyArray(j, 0) newString = MyArray(j, 1) If

Is there a way to disable CommandBar Controls in Powerpoint VBA?

旧街凉风 提交于 2019-12-24 07:18:41
问题 I have a PPT Add-In which may fail if a certain ViewType is not maintained. I do not see any PPTEvent which I could trap the change and prevent it (although, if this is possible, please advise!). So I have been playing with the Ribbon/CommandBars attempting to disable or hide certain controls pertaining to the ViewType. I have identified the controls by Id and I attempt to set their .Visible property to False , or alternatively, to .Enabled = False , but neither seems to have any affect. The

Powerpoint VBA - Move chldnode of Vertical Block List to the left

梦想与她 提交于 2019-12-24 05:47:34
问题 Please check below screenshot & code. It has my questions and code I have written so far (which is failing) Below is my code: Private Sub VerticalBlockList() Dim oPPT As PowerPoint.Application Dim oPres As PowerPoint.Presentation Const ppLayoutTitleAndContent As Byte = 32 Set oPPT = CreateObject("Powerpoint.Application") Set oPres = oPPT.Presentations.Add() Dim layout As SmartArtLayout Set layout = Application.SmartArtLayouts(26) With oPres.Slides.Add(oPres.Slides.Count + 1,

OLEFormat (unknown member): Invalid Request in PowerPoint

懵懂的女人 提交于 2019-12-24 02:23:36
问题 I am using this particular code by Belisarius: Sub a() Dim oSl As PowerPoint.Slide Dim oSh As PowerPoint.Shape Set oSl = ActivePresentation.Slides(1) Set oSh = oSl.Shapes(1) With oSh.OLEFormat.Object.WorkSheets(1) .Range("A1").Value = .Range("A1").Value + 1 .Range("A2").Value = .Range("A2").Value - 1 End With Set oSl = Nothing Set oSh = Nothing End Sub I've embedded a line chart (with the ability to change values in excel) using insert menu in PowerPoint 2010. I'm getting an error that says

How do I copy a Shape from one Powerpoint presentation to another in VBA?

倖福魔咒の 提交于 2019-12-24 01:39:15
问题 I have VBA code to copy shapes matching a certain criteria from one Powerpoint presentation to another below. However, when it pastes the shape, it is offset (down and to the right) from the original position. How can I copy a shape while maintaining the original coordinates? sourceShape.Copy Presentations(2).Windows(1).Activate ActivePresentation.Slides(x).Shapes.Paste (1) 回答1: Perhaps simply: Shape s=ActivePresentation.Slides(x).Shapes.Paste (1) s.Left=sourceShape.Left s.Top=sourceShape.Top

OpenFileDialog VBA (Powerpoint) Initial Directory

此生再无相见时 提交于 2019-12-23 18:54:28
问题 Please help me make my OpenFileDialog showing my PowerPoint project directory. i tried .InitialDirectory = "C:\\" ,but it doesn't work. Can i adapt this to vba? Thanks. 回答1: This is nearly copied from the Powerpoint VBA help. It uses FileDialog instead of OpenFileDialog (which I had difficulty finding in relation to PowerPoint). It sets the InitialFileName to C:\ so that it will prompt in that location. Just place this in a module, it should be easy to modify to your specific needs: Sub

Powerpoint 2011 Mac reports Method 'Export' of object '_Slide' failed

痴心易碎 提交于 2019-12-23 17:18:51
问题 In Powerpoint 2011 (Mac), the following code is returning Run-time error '-2147483640 (80000008)': Method 'Export' of object '_Slide' failed I've tried every variant of this call I could find, this works fine on Windows, and as export appears as a valid method call in Mac VBA should be supported. Can't find any references to the error in Google. So I am stumped as to why this is appearing. Local variable watcher shows oSld as a valid slide, and sImagePath as a valid file name. Any insights

PowerPoint VBA - Paste Special (Enhanced Metafile) bug

↘锁芯ラ 提交于 2019-12-23 12:51:50
问题 I am using a macro in PowerPoint 2003 SP3 to find a specified chart in an Excel workbook, copy it, and then paste it into the current slide as an Enhanced Metafile with, ultimately, the following line of code: Application.ActiveWindow.View.PasteSpecial DataType:=ppPasteEnhancedMetafile As often as it works, I also receive the following error: Run-time error '-2147188160 (80048240)': View (unknown member) : Invalid request. The specified data type is unavailable. If I end the macro and attempt