powerpoint

How do i check whether a File exists using VBA Macro in Powerpoint

此生再无相见时 提交于 2020-06-18 22:10:48
问题 I want to check if a file already exist before running my code. If it exists than exit otherwise keep my code running. What I wrote is following code: Private Sub CommandButton21_Click() If FileFolderExists("C:\Users\Moez\Desktop\Macro_Project\Test1.pptm") Then MsgBox "Modification already done!" Else deleteTextBox AllBlackAndDate LastModifiedDate SaveAllPresentations "C:\Users\Moez\Desktop\Macro_Project\Test1.pptm" ' save here End If End Sub 回答1: If you want to check a file exists on the

Changing language in PowerPoint through VBA returns compile error only in macOS

。_饼干妹妹 提交于 2020-06-17 15:49:31
问题 I have created a macro that changes the correction language of all the elements (text boxes, tables, groups...) in a PPT. I ended up with a code that works perfectly fine in Windows. However, when the macro runs in macOS it gives the error: Compile error: Method or data member not found and highlights " .LanguageID " in the line: Slides(i).Shapes(j).TextFrame.TextRange.LanguageID = iLanguageSelected 回答1: The problem is that the LanguageID property was not included in the TextFrame object in

How to set font size of chart,axis values and axis titles in python-pptx for xyscatter chart

依然范特西╮ 提交于 2020-06-17 09:37:46
问题 I have very simple xy chart that I made with python-pptx (thanks all from stack overflows who helped me with this). I am struggling with setting font size of XTitle, YTitle, ChartTitle, Series Name and also values on x any axis like (0 20 40 60). The pptx documentation is not very clear to me from pptx import Presentation from pptx.util import Inches,Pt from pptx.enum.chart import XL_CHART_TYPE from pptx.chart.data import XySeriesData,XyChartData prs = Presentation() title_slide_layout = prs

VBA Powerpoint - How to *un* highlight selected text

你离开我真会死。 提交于 2020-05-31 04:03:11
问题 A helpful SO member highlighted here how to use the .Font.Highlight property of TextRange2 in PowerPoint to add a highlight to selected text; however I haven't been able to fathom how to remove the highlight from within VB. In particular either of the following... ActiveWindow.Selection.TextRange2.Font.Highlight.RGB = 0 OR ActiveWindow.Selection.TextRange2.Font.Highlight = 0 ...result in black highlighting instead of no highlighting. Using False or msoFalse in place of the zeros has the same

vba powerpoint merge cells in loop

孤人 提交于 2020-05-29 10:04:31
问题 I'm trying to put together some code that merges cells where there is duplicate content in the row above. The code works, but once I get to the third row, I get an error that says: Cell (unknown number): Invalid Request. Cannot merge cells of different sizes. When I go back to the UI, I can perform the merge manually, so I don'be believe that the cells are different sizes. So I am thinking it is a problem with my code or a limitation of the VBA .Merge method? Code is below Sub

Add audio clip via VBA to PowerPoint Presentation that spans multiple slides

ⅰ亾dé卋堺 提交于 2020-05-27 06:47:27
问题 To play an audio clip inserted as a shape across multiple slides in a presentation, there is an option in the Play Sound dialog in the Effect tab called Stop playing and this can be set to After __ slides . I've browsed the object model and even attempted recording a macro using ppt 2003 (the option does not record). How (if it can) can this option be set via VBA ? The way I'm currently adding a sound (that stops after the slides are advanced) is: Dim oSlide As Slide Dim oShp As Shape Dim

Why does a countdown timer freeze when placed in SlideMaster?

被刻印的时光 ゝ 提交于 2020-05-14 18:22:07
问题 I used the following code to have a Countdown which would span over 10 slides whilst in slideshow mode. I placed the shapes in a SlideMaster Layout. Set QS = ActivePresentation.Designs(2).SlideMaster.CustomLayouts(2) Dim Seconds As Integer Seconds = 30 QS.Shapes("Counter").TextFrame.TextRange = Seconds For i = 1 To 30 Dim WAIT As Double WAIT = Timer While Timer < WAIT + 1 DoEvents Wend Seconds = Seconds - 1 QS.Shapes("Counter").TextFrame.TextRange = Seconds Next i Dim time As Date Dim count

VBA Error 1004 : Method “Close” of Chart.ChartData.Workbook object Failed

元气小坏坏 提交于 2020-05-14 09:04:09
问题 I have a macro that updates a ppt presentation charts from a monthly updated Excel file. It has been working like a charme for a couple of months. Since a few days ago, I have a problem to close the charts Workbook after updating their numbers and I get a 1004 runtime error. Here is the code : With .Slides(1).Shapes("gmbDiscoveryRateChart").Chart.ChartData .Activate .Workbook.Sheets(1).Range("B2").value = currentGmbDiscoveryRate .Workbook.Sheets(1).Range("B3").value = 1 -

How to read text boxes inside the chart area python pptx?

为君一笑 提交于 2020-04-30 06:28:00
问题 I am trying to automate a ppt using pptx-python library. I'm using a template. There are few charts in some of the slides. And charts have text boxes in it. I tried looping over the shapes to get the shape_id of those text boxes but I couldn't find the shape_id . And when I tried to drag the text box out of the chart area it didn't come out. It seems the text box is part of the chart area. There are two areas chart area and plot area and text boxes are inside the chart area and plot area

How to read text boxes inside the chart area python pptx?

◇◆丶佛笑我妖孽 提交于 2020-04-30 06:26:29
问题 I am trying to automate a ppt using pptx-python library. I'm using a template. There are few charts in some of the slides. And charts have text boxes in it. I tried looping over the shapes to get the shape_id of those text boxes but I couldn't find the shape_id . And when I tried to drag the text box out of the chart area it didn't come out. It seems the text box is part of the chart area. There are two areas chart area and plot area and text boxes are inside the chart area and plot area