Results 1 to 2 of 2

Thread: Run-time error - does ANYBODY know?

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Location
    Posts
    1

    Unhappy

    In attempting to open a PowerPoint presentation via VB, the following run-time error occurs: -2147297010(8003001e) - a disk error occurred during a read operation.
    Any help is appreciated - Thanks.
    Here's a snippet of the code:
    It works fine on the machine it was created on. But no others.
    __________________________________________________________
    Public Sub cmdCommand3_Click
    Dim sTopic As String
    Dim sFile As String
    Dim sParams As Variant
    Dim sDirectory As Variant

    sTopic = "Open"
    sFile = "powerpnt.exe"
    sParams = "112-2pj.ppt"
    sDirectory = 0&

    Call RunShellExecute(sTopic, sFile, sParams, sDirectory, SW_SHOWNORMAL)
    End Sub
    __________________________________________________________
    Public Sub RunShellExecute(sTopic As String, sFile As Variant, _
    sParams As Variant, sDirectory As Variant, _
    nShowCmd As Long)
    Dim hWndDesk As Long
    Dim success As Long
    Const SE_ERR_NOASSOC = &H31
    hWndDesk = GetDesktopWindow()
    success = ShellExecute(hWndDesk, sTopic, sFile, sParams, sDirectory, nShowCmd)
    'If success = SE_ERR_NOASSOC Then
    ' Call Shell("rundll32.exe shell32.dll,OpenAs_RunDLL " & 'sFile, vbNormalFocus)
    'End If

    End Sub

  2. #2
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    There is an easier way to do this.

    On projects menu click References. From the resulting dialog box, select Microsoft PowerPoint 9.0 Object Library. Then use the following code.

    Dim Pwrpnt As New PowerPoint.Application
    Dim Ppt As PowerPoint.Presentation

    Sub OpenSlideShow(Fle as String)
    Pwrpnt.Visible = True
    Set Ppt = Pwrpnt.Presentations.Open(Fle)
    End Sub

    Sub Test()
    OpenSlideShow "C:\My Documents\My Presentation.ppt"
    End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width