简体   繁体   中英

Powerpoint 2011 Mac reports Method 'Export' of object '_Slide' failed

In Powerpoint 2011 (Mac), the following code is returning Run-time error '-2147483640 (80000008)': Method 'Export' of object '_Slide' failed

I've tried every variant of this call I could find, this works fine on Windows, and as export appears as a valid method call in Mac VBA should be supported. Can't find any references to the error in Google. So I am stumped as to why this is appearing.

Local variable watcher shows oSld as a valid slide, and sImagePath as a valid file name.

Any insights into what's going here would be gratefully appreciated....

Sub devtests()
  Dim oSlides As Slides
  Dim sImagePath As String
  Dim oSld As Slide
  Dim oPres As Presentation

  Set oPres = ActivePresentation
  Set oSlides = oPres.Slides
  sImagePath = "MacSSD:Users:myuserdir:test:"
  For Each oSld In oSlides
     sImagePath = sImagePath & Format(oSld.SlideIndex, "000") & ".jpg"
      Call oSld.Export(sImagePath, "JPG")
            'also tried - oSld.Export sImagePath, "JPG"
    Next oSld
End Sub

I can repro the problem here. I think you've turned up a bug. There are lots of 'em in 2011 VBA + PowerPoint, unfortunately. VBA had to be completely rewritten for this release, as I understand it, and it's always the step-child when it comes to commanding dev resources.

I've reported the problem to some Mac-type people I know at MS. Will let you know if I hear anything useful back from them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM