Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Run time error '1004': Generaol ODBC error | Excel Programming | |||
Run time error 1004 General ODCB Error | Excel Programming | |||
Application Run Time Error 1004 and Stack Error | Excel Programming |