Results 1 to 16 of 16

Moving text from Excel to PowerPoint

Threaded View

Wyrmfyre Moving text from Excel to... 09-01-2010, 10:21 PM
Andy Pope Re: Moving text from Excel to... 09-02-2010, 04:49 AM
Wyrmfyre Re: Moving text from Excel to... 09-03-2010, 06:12 PM
MarvinP Re: Moving text from Excel to... 09-03-2010, 06:34 PM
MarvinP Re: Moving text from Excel to... 09-03-2010, 06:55 PM
Wyrmfyre Re: Moving text from Excel to... 09-03-2010, 08:17 PM
Wyrmfyre Re: Moving text from Excel to... 09-03-2010, 08:43 PM
MarvinP Re: Moving text from Excel to... 09-03-2010, 11:29 PM
snb Re: Moving text from Excel to... 09-04-2010, 07:09 AM
Wyrmfyre Re: Moving text from Excel to... 09-04-2010, 09:34 AM
teylyn Re: Moving text from Excel to... 09-04-2010, 09:51 AM
snb Re: Moving text from Excel to... 09-04-2010, 10:08 AM
Wyrmfyre Re: Moving text from Excel to... 09-04-2010, 11:18 PM
MarvinP Re: Moving text from Excel to... 09-05-2010, 12:41 AM
Andy Pope Re: Moving text from Excel to... 09-05-2010, 05:54 AM
teylyn Re: Moving text from Excel to... 09-05-2010, 05:54 AM
  1. #1
    Registered User
    Join Date
    09-01-2010
    Location
    Goodyear, AZ
    MS-Off Ver
    Excel 2007
    Posts
    6

    Unhappy Moving text from Excel to PowerPoint

    Hey Gang,

    I am pretty new to VB in Excel and would still consider myself a novice, but I am having some difficulty getting text in Excel (2007) to populate in text boxes in PowerPoint. I have created the public function to define the parameters and also created a small sub to move text. When I run the sub I get this error: "Run-time error '5': Invalid procedure call or argument". When I run a debug of the sub, it steps through the sub fine and moves to reference the public function, then gives the same error when it hits this line

    PPSlide.Shapes(textbox).TextFrame.TextRange = Text
    You can see the full code for this section of the public function and how the above line fits in below.

    Public Function copy_text(sheet, rowStart, columnStart, row_count, columnCount, slide, textbox)
    
    Sheets(sheet).Select
    Text = Cells(rowStart, columnStart).Resize(row_count, columnCount).Text
    
    
    ' Reference existing instance of PowerPoint
    Set PPApp = GetObject(, "Powerpoint.Application")
    ' Reference active presentation
    Set PPPres = PPApp.ActivePresentation
    PPApp.ActiveWindow.ViewType = ppViewSlide
    PPApp.ActiveWindow.View.GotoSlide (slide)
    ' Reference active slide
    Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
    
    PPSlide.Shapes(textbox).TextFrame.TextRange = Text
    
    ' Clean up
    Set PPSlide = Nothing
    Set PPPres = Nothing
    Set PPApp = Nothing
    
    
    End Function
    I have looked this over a hundred times and have shown it to a number of different people, but no one can seem to pinpoint exactly what is going on. Is my public function wrong or am I referencing the spreadsheet incorrectly? Any help in this would be greatly appreciated. Thanks in advance!

    -Bill
    Last edited by Wyrmfyre; 09-03-2010 at 06:09 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1