Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Unanswered: Command Button Error

    I'm wanting to add a command button, that when clicked will open an excel workbook, paste the data, and allow the user to edit the spreadsheet.

    Here's what I have:

    Private Sub Command246_Click()
    Dim mysheet As Object, myfield As Variant, xlApp As Object

    Set xlApp = CreateObject("Excel.Application")
    Set mysheet = xlApp.workbooks.Open("T:\War.xls").Sheets(1)

    myfield = Master!Payee
    mysheet.cells(1, 1).Value = myfield
    mysheet.cells(1, 1).Font.Bold = True"ole_test.xls").Visibl e = True

    Set mysheet = Nothing
    End Sub

    I'm getting a 424 Error on the "myfield = Master!Payee"

    Master is the name of my Form and Table. Any ideas?

  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    What is master? Are you referencing the form, or the table? Have you tried being more explicit? forms!master!payee ?

Posting Permissions

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