Consulting

Results 1 to 2 of 2

Thread: Solved: Text from PowerPoint to Excel

  1. #1
    VBAX Regular
    Joined
    Sep 2005
    Location
    Rome
    Posts
    20
    Location

    Solved: Text from PowerPoint to Excel

    Hi all,
    Here's another problem that has me stumped ...
    I'm trying to transfer data from a PowerPoint file to an Excel one using the following code, but I keep getting errors.
    Any ideas?

    [VBA]
    Private Sub CommandButton1_Click()
    Dim myVocab As Object
    Dim myfullPath As String
    myfullPath = ActivePresentation.Path & "\Task.xls" 'Excel file

    Set myVocab = GetObject(myfullPath)
    With myVocab
    .Application.Activate
    .Application.Visible = True

    With ActiveWorkbook
    .Sheets("Grid").Range("A2") = "14" 'Text to transfer

    End With
    End With
    End Sub
    [/VBA]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    How about

    [VBA]
    Private Sub CommandButton1_Click()
    Dim myVocab As Object
    Dim myfullPath As String
    myfullPath = ActivePresentation.Path & "\Task.xls" 'Excel file

    Set myVocab = GetObject(myfullPath)
    With myVocab
    .Activate
    .Windows(1).Visible = True

    .Sheets("Grid").Range("A2") = "14" 'Text to transfer
    End With

    myVocab.Close
    Set myVocab = Nothing

    End Sub
    [/VBA]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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