Results 1 to 2 of 2

Thread: Getobject from ole?

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    india
    Posts
    39

    Question

    My problem is
    I want to enter the values from the textbox to the already existing xlbook say "C:\STOCK.XLS"
    How to add the following code in the xlbook.
    Xlsheet.cells(2,1)=text1.text


    Private Sub Form_Load()
    Set xlBook = GetObject("C:\STOCK.xls")
    ' Display Microsoft Excel and the Worksheet
    ' window.
    xlBook.Application.Visible = True
    xlBook.Windows(1).Visible = True
    End Sub

    ppr

  2. #2
    Member
    Join Date
    Jan 2001
    Location
    Washington, USA
    Posts
    61

    This should do it

    To enter a value (Text1.text) into
    Column 'A'
    Row '8'
    Worksheet '1'
    use the following
    xlBook.Worksheets(1).Range("C8").value = Text1.text

    Does this work?

    Samwise Galenorn
    [email protected]

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