<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[הפעלת פונקציה בvba בPowerPoint בהפעלת המצגת]]></title><description><![CDATA[<p dir="auto">יש לי מצגת בPowerPoint שאני מעוניין לאפשר את עריכת הנתונים (תיבות טקסט וכדו') גם באמצע ההצגה של המצגת.</p>
<p dir="auto">אני יודע שזה אפשרי באמצעות תצוגת מגיש, שבה עריכה נראית ישר למסך, אבל אני מעוניין שהמשתמש (הפשוט..) לא יצטרך לשחק בקובץ עצמו, כי זה עשוי לגרום למלא בעיות מלבד אי הנוחות שבדבר, לכן חשבתי לעשות קובץ אקסל, שבו יהיו הנתונים ולכתוב פונקציה שתקרא את הנתונים מהאקסל ותכניס אותם כל אחד למקומו במצגת (על אותו רעיון ניתן לטפל באובייקטים וכו' באמצעות התנייה שהtrue שלה יגיע מהאקסל..).</p>
<p dir="auto">הפונקציה עצמה כבר כתובה ועומדת (בבסיס), אבל אני רוצה שהיא תופעל בלופ מיד עם הפעלת המצגת ועד לסיומה, כיצד אני יכול לעשות את זה?</p>
<p dir="auto">להלן הפונקציה לקריאה מהאקסל ורישום לתיבת הטקסט בPowerPoint, אשמח להערות</p>
<pre><code>Sub ReadFromExcelAndUpdate()
    Dim slide As slide
    Dim textBox As Shape
    Dim text As String
    Dim excelApp As Object
    Dim excelWorkbook As Object
    Dim excelWorksheet As Object
    Dim ifClose As Boolean
    
    Set slide = ActivePresentation.Slides(1)
    Set textBox = slide.Shapes("TextBox1")
    
    On Error Resume Next
    Set excelApp = GetObject(, "Excel.Application")
    On Error GoTo 0
    
    If excelApp Is Nothing Then
        Set excelApp = CreateObject("Excel.Application")
        ifClose = True
    End If
    
    On Error Resume Next
    Set excelWorkbook = excelApp.Workbooks.Open("C:\Users\Booklet1.xlsx")
    On Error GoTo 0
    
    If Not excelWorkbook Is Nothing Then
        Set excelWorksheet = excelWorkbook.Sheets("port96")
        text = excelWorksheet.Range("D5").Value
        textBox.TextFrame.TextRange.text = text
    End If
    
    If ifClose Then
        excelWorkbook.Close False
        excelApp.Quit
    End If

    Set excelWorksheet = Nothing
    Set excelWorkbook = Nothing
    Set excelApp = Nothing
End Sub
</code></pre>
]]></description><link>https://tchumim.com/topic/15292/הפעלת-פונקציה-בvba-בpowerpoint-בהפעלת-המצגת</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Mar 2026 12:45:01 GMT</lastBuildDate><atom:link href="https://tchumim.com/topic/15292.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Jul 2023 05:07:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to הפעלת פונקציה בvba בPowerPoint בהפעלת המצגת on Tue, 18 Jul 2023 17:44:54 GMT]]></title><description><![CDATA[<p dir="auto">Private Sub App_PresentationOpen(ByVal Pres As Presentation)</p>
]]></description><link>https://tchumim.com/post/155233</link><guid isPermaLink="true">https://tchumim.com/post/155233</guid><dc:creator><![CDATA[pcinfogmach]]></dc:creator><pubDate>Tue, 18 Jul 2023 17:44:54 GMT</pubDate></item></channel></rss>