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

I keep on getting the error above at the end of my routine. I use the same
routine on many other types of reports, however, I don't get the error on
those reports. I can't figure it out. Any ideas?

x = 2
i = 5

Sheets("L001.TXT").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A1:AA65536").Select
Selection.ClearContents
Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

y = Range("L001.TXT!G" & Rows.Count).End(xlUp).Row + 1 'Assumes nothing
beneath the
Range("L001.TXT!G" & y).Value = "X"

Sheets("MAIN").Select
Range("A1").Select

Application.StatusBar = "Loading data ...."

Do While Range("L001.TXT!G" & X) < "X"
If Range("L001.TXT!B" & X) = "OFF" Then
Do While Len(Range("L001.TXT!G" & X + 1)) 0
Range("IRES!J" & i).Value = "023"
Range("IRES!D" & i).Value = Format(Range("L001.TXT!B" & X + 1),
"000") & Format(Range("L001.TXT!D" & X + 1), "000") & "C"
Range("IRES!A" & i).Value = Date
Range("IRES!B" & i).Value = "IRES"
Range("IRES!H" & i).Value = "OPEN"
Range("IRES!I" & i).Value = "1ST"
Range("IRES!E" & i).Value = "N/A"
Range("IRES!F" & i).Value = "POLICY: " & Range("L001.TXT!G" & X
+ 1).Value
i = i + 1
X = X + 1
Loop
End If
X = X + 1
Loop


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Run-time error 1004

I figured it out. It was jumping over my "X" check and going to the button
of the spreadsheet.


"dthmtlgod" wrote in message
...
I keep on getting the error above at the end of my routine. I use the same
routine on many other types of reports, however, I don't get the error on
those reports. I can't figure it out. Any ideas?

x = 2
i = 5

Sheets("L001.TXT").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A1:AA65536").Select
Selection.ClearContents
Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

y = Range("L001.TXT!G" & Rows.Count).End(xlUp).Row + 1 'Assumes nothing
beneath the
Range("L001.TXT!G" & y).Value = "X"

Sheets("MAIN").Select
Range("A1").Select

Application.StatusBar = "Loading data ...."

Do While Range("L001.TXT!G" & X) < "X"
If Range("L001.TXT!B" & X) = "OFF" Then
Do While Len(Range("L001.TXT!G" & X + 1)) 0
Range("IRES!J" & i).Value = "023"
Range("IRES!D" & i).Value = Format(Range("L001.TXT!B" & X + 1),
"000") & Format(Range("L001.TXT!D" & X + 1), "000") & "C"
Range("IRES!A" & i).Value = Date
Range("IRES!B" & i).Value = "IRES"
Range("IRES!H" & i).Value = "OPEN"
Range("IRES!I" & i).Value = "1ST"
Range("IRES!E" & i).Value = "N/A"
Range("IRES!F" & i).Value = "POLICY: " & Range("L001.TXT!G" & X
+ 1).Value
i = i + 1
X = X + 1
Loop
End If
X = X + 1
Loop




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
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Run time error '1004': Generaol ODBC error Dwaine Horton[_3_] Excel Programming 2 April 26th 05 02:52 PM
Run time error 1004 General ODCB Error Kevin Excel Programming 3 February 26th 05 12:51 PM
Application Run Time Error 1004 and Stack Error ExcelMonkey[_190_] Excel Programming 9 February 11th 05 04:48 PM


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