LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default Late Binding

At the present time I am using Excel 97, With the help of participants on
this newsgroup and using Excel XP, I managed to put together some code which
copied an excel spreadsheet into powerpoint.

The following code worked fine on Excel XP but I needed it to work on all
versions of Excel so I have now used Late Binding instead of referencing it.

Unfortunately now I have done this I am getting debug errors on:

ppLayoutText
ppPasteMetafilePicture

Can anyone help with a solution, please?

Here is some of the code
*****************

Dim pptApp As Object
Dim pptPres As Object
Dim pptSlide As Object
Dim pptShape As Object

Set pptApp = CreateObject("PowerPoint.Application")
Set pptPres = pptApp.Presentations.Add(msoTrue) ' create a new presentation
' or open an existing presentation
' Set pptPres = pptApp.Presentations.Open("C:\Foldername\Filename. ppt")

' apply a slide template
pptPres.ApplyTemplate "C:\Program Files\Microsoft
Office\Templates\Presentation Designs\Contemporary Portrait.pot"


For Each asheet In ActiveWorkbook.Sheets
' only officer sheets visible at this point
If asheet.Visible = True Then
sheetname = asheet.Name
Worksheets(sheetname).Activate

With ActiveSheet
.Shapes("Slide").Copy ' copy a picture from Excel

With pptPres.Slides
Set pptSlide = .Add(.Count + 1, ppLayoutText) ' add a slide
End With

With pptSlide

.Shapes(1).Delete ' remove title
'.Shapes(2).Delete ' remove the text box
.Shapes.PasteSpecial ppPasteMetafilePicture

With .Shapes(.Shapes.Count)
.Left = 0
.Top = 0
.Width = 720
.Height = 540
End With
End With
End With
End If
Next asheet

etc.....

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
Late Binding help, Please Bud Dean Excel Programming 5 September 24th 04 04:31 AM
Late Binding Todd Huttenstine[_3_] Excel Programming 3 April 30th 04 11:01 AM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM
DAO Late Binding? Sharqua Excel Programming 2 January 4th 04 02:05 AM


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"