Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveCell not recognized
I've got a VB6-application with a command button, which holds this
code: '---code begin Dim xlo As excel.Application Dim xloW As excel.Workbook Dim myCount As Integer, x As Integer, NewMeasure As Integer Dim isEven As Boolean Set xlo = New excel.Application Set xloW = xlo.Workbooks.Open("u:\excel\kontrolkort.xls") xloW.Application.Visible = True xloW.Worksheets(1).Range("G42").Value = Me.Antal_n --- whole lotta code left out ---- ActiveCell.Value = CSng(Me.List1.Text) ' <------ ActiveCell.Offset(1, 0).Activate End With NewMeasure = NewMeasure + 1 End If Next x Set xloW = Nothing Set xlo = Nothing '---code end The first time I run the code, everything is fine and the ActiveCell is given a value. But the second time it fails on the line given with arrow. Why? It fails with: "Run-time error 91: Object variable or With block not set" It is the xloW variable that is nothing. Why isn't it set the second time? Thanks in advance! Regards, Snedker |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UDF Not recognized | Excel Worksheet Functions | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
date not recognized | Excel Discussion (Misc queries) | |||
Blank Value not recognized? | Excel Worksheet Functions | |||
Data isn't being recognized. | Excel Worksheet Functions |