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
Bookmarks