Results 1 to 3 of 3

Run-time error '424' (object required)

Threaded View

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    4

    Question Run-time error '424' (object required)

    Hello

    The 424 error occurs when an object is necessary.
    I’m having trouble to reference an instruction to a property of an object.
    The object in question was created in a form and the instruction that needs it belongs to a class of functions.
    I tried starting and restarting and create a new object in the function, but I got the error 91 (Object variable or with block variable not set).

    Question: How do I refer the instruction to the object property already created?
    Data:
    The instruction belongs to Excel.Application.

    I’m using VB6.

    this snippet of code belongs to the form:
    -----------------------------------------
    Dim xl As Excel.Application
    Dim xlw As Excel.Workbook
    Set xl = CreateObject("Excel.Application")
    Set xlw = xl.Workbooks.Open(ARQUIVO_DE_REFERENCIA)
    xl.Visible = True
    ------------------------------------------------------------
    this snippet of code function:
    -----------------------------------------------------------
    Sheets("PlanB").Select
    line= ActiveCell.Row
    column = ActiveCell.Column
    Sheets("PlanA").Select
    Range("A1:I48").Select
    xl.Selection.Copy
    Sheets("PlanB").Select
    Range("A" & Line+ 3).Select
    ActiveSheet.Paste
    Range(column & ":" & Line + 5).Select
    ----------------------------------------------------------
    the instruction Selection.Copy that referenced to the object xl
    Last edited by arlu1201; 02-14-2013 at 08:49 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1