Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF Not recognized Rookie_User Excel Worksheet Functions 3 January 29th 10 10:16 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
date not recognized The Stumper Excel Discussion (Misc queries) 8 May 22nd 07 02:57 PM
Blank Value not recognized? Laura Excel Worksheet Functions 3 January 24th 07 12:14 AM
Data isn't being recognized. ConfusedDataMonkey Excel Worksheet Functions 1 January 20th 05 04:41 PM


All times are GMT +1. The time now is 02:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"