Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Runtime error 1004

Hi,

i am using MSAccess and trying to build an Excel sheet

i am using range method to put some values which i get at runtime

i am getting an error - Run time Error '1004'

Method 'Range'of object '_Worksheet' failed

this is the sample code i am using

xlSht.Range("A" & Val(lngrow + 26)).Value = rst!COLRNM

this line is actually in a loop, and executes fine a few times but raises
this error intermittently.

Please help

Gary


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Runtime error 1004

What's the value of lngrow when you get the error? Of what type is
lngrow? If lngrow is of type long, then calling VAL() is unnecessary
- just use lngrow + 26.

Is xlSht always a worksheet? Or might it be a chart sheet?



In article ,
"Gary" wrote:

Hi,

i am using MSAccess and trying to build an Excel sheet

i am using range method to put some values which i get at runtime

i am getting an error - Run time Error '1004'

Method 'Range'of object '_Worksheet' failed

this is the sample code i am using

xlSht.Range("A" & Val(lngrow + 26)).Value = rst!COLRNM

this line is actually in a loop, and executes fine a few times but raises
this error intermittently.

Please help

Gary


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
runtime error 1004 HELP PLS Marcelo P Excel Discussion (Misc queries) 2 May 23rd 07 08:56 PM
runtime error '1004' Steve Excel Discussion (Misc queries) 1 April 28th 06 08:58 PM
What causes runtime error 1004? [email protected] Excel Discussion (Misc queries) 4 October 27th 05 07:15 PM
runtime error 1004 valdesd Excel Discussion (Misc queries) 0 October 12th 05 05:30 PM
Runtime Error '1004' [email protected] Excel Discussion (Misc queries) 2 July 18th 05 06:10 AM


All times are GMT +1. The time now is 06:56 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"