Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul:
I have the following code for an Excel worksheet, it works on the first try but it fails on the second time. It returns an error saying "Object variable or With block variable not set". Thanks .Range("A6").Select If Not rs1.BOF Then rs1.MoveFirst Do While Not rs1.EOF strPurchaseOrder = rs1!PurchaseOrder 'Assign Purchase Order to Excel ActiveCell.Offset(1, 0).Select..............................it fails here. The message you get means that you try to work with an object variable that has no contents / context yet. In your example I would guess that you probably has got no selection in your sheet or that the ActiveCell is not existing. To me these two seems to be conflicting, either you have ONE acitve cell or you have a selection. Or am I completely wrong here? Nevertheless, check all variables for their contents in your function call to see which one is not set yet. -- ( )---cucchiaino |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
Excel VBA Write to xls ? | Excel Programming | |||
Loop,Compare,Write | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |