powerpoint-vba

Change the image of an image shape

喜欢而已 提交于 2019-12-06 15:04:15
I want to be able to change the image of an image shape by clicking on an button in my userform. In the internet I found the function UserPicture , but the image simply stays the same. Private Sub ChangeImage_Click() ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Visible = True ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Fill.UserPicture ("D:\User\Desktop\SolutionWrong.jpg") End Sub Private Sub HideImage_Click() ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Visible = False End Sub When I click on the HideImage button, the shape becomes invisible

PowerPoint 2007/2010 VBA ppam Add-In does not show up in VBA editor when open

怎甘沉沦 提交于 2019-12-06 11:08:03
问题 I've created a PowerPoint 2007/2010 VBA Add-In (.ppam) some code in a module. I've also added an XML ribbon (not important, but it shows me that the file is in fact open in PowerPoint). I can click a button in the ribbon I created and it will execute code from my module. cool. When I open the VBA editor (ctrl + F11), the Add-In does not show up. In fact, if I don't have another document open I can't even open the editor. I've tried this in PowerPoint 2007 and 2010. How can I edit the code of

Export Excel Charts as Images using Powerpoint VBA

感情迁移 提交于 2019-12-06 08:05:07
I have the below code that I have written to export "Chart1" from an Excel sheet called "Sheet1" to a new slide in a created instance of powerpoint: Sub ChartsToPowerPoint() Dim pptApp As PowerPoint.Application Dim pptPres As PowerPoint.Presentation Dim pptSlide As PowerPoint.Slide Dim pptSlideCount As Integer Dim ws As Worksheet Dim intChNum As Integer Dim objCh As Object 'Open PowerPoint and create a new presentation. Set pptApp = New PowerPoint.Application Set pptPres = pptApp.Presentations.Add 'Set the chart and copy it to a new ppt slide Set objChart = Worksheets("Sheet1").ChartObjects(

Reading in data from text file into a VBA array

て烟熏妆下的殇ゞ 提交于 2019-12-06 07:05:38
问题 I have the following VBA code: Sub read_in_data_from_txt_file() Dim dataArray() As String Dim i As Integer Const strFileName As String = "Z:\sample_text.txt" Open strFileName For Input As #1 ' -------- read from txt file to dataArrayay -------- ' i = 0 Do Until EOF(1) ReDim Preserve dataArray(i) Line Input #1, dataArray(i) i = i + 1 Loop Close #1 Debug.Print UBound(dataArray()) End Sub ...that I'm trying to use to read in text line by line (assume 'sample.txt' is a regular ascii file) from a

AppleScriptTask throwing an error 5 - invalid procedure call or argument

旧街凉风 提交于 2019-12-06 06:22:00
I'm facing a problem on Mac 2016 Powerpoint. In my VBA module I need to run an applescript. As we cannot use MacScript anymore I followed RonDeBruin's explanation to use AppleScriptTask. My Applescript is working fine on his own but when I try to call it like this : AppleScriptTask("hello.scpt", "myhandler", "hello") With in my apple script on myhandler(paramString) say paramString End myhandler It gives me an error 5 - Invalid procedure call or argument my script is placed in Library/Application Scripts/com.microsoft.Powerpoint is this path alright? Thank you for your help I did get that

Error: “The specified data type is unavailable” When pasting Shapes as PNG format in PowerPoint

核能气质少年 提交于 2019-12-06 05:28:11
I need to write a macro to convert all grouped diagrams (shapes, arrows and text) in a PPT presentation to PNGs. (I am converting the PPTs using some eLearning software and the diagrams end up corrupt; and I need them to be PNGs because enhanced metafiles also present issues). I've been using some slightly modified code from a macro that converts Pictures (enhanced meta files) to PNGs. All I did was change msoPicture to msoGroup: Sub ConvertAllPicsToPNG() Dim oSl As Slide Dim oSh As Shape For Each oSl In ActivePresentation.Slides For Each oSh In oSl.Shapes ' modify the following depending on

Changing the properties of elements in Office Ribbon using VBA

让人想犯罪 __ 提交于 2019-12-06 03:00:00
问题 I am a beginner in VBA and Office Ribbon UI. I am using Office 2007 and used Custom UI to develop a Ribbon in PPTM. I have added a set of XML like the one below: <group id="myGroup" label="Hello World" visible="false"> <labelControl id="lblUsername" label="Your Username: " /> <labelControl id="lblFullname" label="" /> </group> So, in this Hello World tab, I would like to change its visibility to true and change the the values of lblUsername and lblFullname . Currently this has to be done

How can I determine if my VB code is running on Office 2016 for Mac?

て烟熏妆下的殇ゞ 提交于 2019-12-05 20:02:53
Is there a conditional that I can use to differentiate if my Macro is running on Office 2016 for Mac or Office for Mac 2011 In Office 2016 for Mac, there is a new conditional called MAC_OFFICE_VERSION to test which VB version the user is running. The following example shows how it to use it in your code: Sub VersionConditionals() #If MAC_OFFICE_VERSION >= 15 Then Debug.Print "We are running on Mac 15+" #Else Debug.Print "We are not running on Mac 15+" #End If #If Mac Then Debug.Print "We are running on a Mac" #Else Debug.Print "We are not running on a Mac" #End If End Sub Note: The "#If Mac"

How to make a progress bar in powerpoint vba?

坚强是说给别人听的谎言 提交于 2019-12-05 12:27:41
How can I make a progress bar with PowerPoint VBA? It should be done as an animation on a slide. Is this what you're looking for? http://www.pptfaq.com/FAQ00597.htm This one will put the bar at the top and prevent it from appearing on the first slide (unlike the pptfaq script): http://www.faronics.com/news/blog/how-to-add-a-progress-bar-to-powerpoint/ In Power Point, go to Tools > Macro > Visual Basic Editor. In Office 2010 you might need to activate the Developer tab in order to get to the editor. The Mac version will take you there through Developer tab > Editor. Once you are in the editor,

Where do I get started with VBA and macros programming in Word 2007?

淺唱寂寞╮ 提交于 2019-12-05 10:27:53
I just came to know that macros in Word/Excel/PowerPoint can be programmed. That is awesome because I've a Word document with 70 tables for styling. I'm a programmer but I don't know VB, VBA or VB .NET. I'm confused with these three. I'm familiar with .NET programming using C#. Now I want to write new macros. Where should I get started? What are VB, VBA, VB.NET and which one should I learn? Please suggest some material. If I learn for Word 2007 will that help with other Office applications life Excel & PowerPoint? Todd Main There are some good answers here - I'd like to offer one more set of