CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Posts
    3

    Client Application [Excel]

    When I use the following code (with MicroSoft Excel 8.0 Object Library referenced):
    Private Sub Command_Click()
    Dim objExcel As Object
    Set objExcel = CreateObject("Excel.Sheet")
    objExcel.Cells(1,1).Value = "2"
    End Sub

    there is a run time error (438, "object does not support the propterty or method at the last code line (objExcel.Cells(1,1).Value = "2"
    CAN ANYONE HELP?



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Client Application [Excel]

    this works only when you have a workbook as in

    Dim x as Excel.Application
    set x = CreateObject("excel.application")
    x.Visible = true
    Dim w as Excel.Workbook
    set w = x.Workbooks.Add
    x.Cells(1, 1).Value = "2"






  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    A bit of Knowledge from Past


    Sorry, Lothar: I am out of votes for today...

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured