Runtime Error 1004

I have a workbook with VBA and I am getting a 'Run-time Error 1004' and when I hit the debug the process stops at below lines of codes:
' Insert blank rows, one to hold each period and one for the total line
    With resultArea.Cells(RowNum, KeyFigCol - 1)  {it says Application defined or Object defined error}
    If .Value <> "" Then
I saw other threads for this error and I checked the OSS-429183. Also my macro>>security is set to low.
Any suggestions? Plus I am getting this error only in dev environment, stage & production work fine. I have verified the VBA code and they all have same code.

Hi All, I still have this problem. I have the same VBA code in all the systems, but it gets error in development system only. its working fine in other systems. That's what breaks my head:(
Any suggestions. I have attached my VBA code.
'* Variable Declarations
  Dim Column As Integer
  Dim StrPos As Long
  Dim TempStr As String
  Dim RowNum As Integer
  Dim StrRowNum As Integer
  Dim EndRowNum As Integer
  Dim EndColNum As Integer
  Dim KeyFigCol As Integer
  Dim DelStrCol As Integer
  Dim LabelPos As Integer
  Dim ActiveCellSave As String
  Dim MonthFlag As String
  Dim MonthFlagPrev As String
  Dim MonthColStr As Integer
  Dim MonthColEnd As Integer
  Dim MonthCol1st As Integer
  Dim MatMonRow As Integer
  Dim ColPrjAvl As Integer
  Dim ColTopGrn As Integer
  Dim ColTopYel As Integer
  Dim ColTopRed As Integer
  Dim ColRmdRpl As Integer                   '001A
  Dim ColMaxQty As Integer
  Dim ColRplQty As Integer
  Dim First As Boolean
  Dim NumPeriods As Integer                  '001A
  Dim UsgPerDay As Integer                   '001A
  Dim StartTime
  Dim EndTime
' Check the query id to determine which sheet to activate
If queryID = "SAPBEXq0016" Then      'Monthly Query
  'Application.ScreenUpdating = False
'Set sheet "Inventory Montly Analysis" to active
  Sheets(3).Activate
  NumPeriods = 13                              '001A
'* 001A: Set "Inventory Weekly Analysis" to active
ElseIf queryID = "SAPBEXq0018" Then  ' Weekly query
  Sheets(4).Activate
  NumPeriods = 24
'* 001A: Set "Inventory Replenishment" to active
ElseIf queryID = "SAPBEXq0017" Then  ' Replenishment Detail query
  Sheets(6).Activate
  NumPeriods = 0
Else
  Exit Sub
End If
'* 001A: End of new code
'* Initialization Routines
  First = True
' For performance testing, save off the start time of the macro
  StartTime = Time
' Save off the current cell location so that we can restore that location
' when formatting is compelte
  ActiveCellSave = ActiveCell.Address()
  If ActiveCell.Value <> "No applicable data found." Then
' Determine the First Row in the spreadsheet where query results are displayed
' The first row will be stored in variable RowNum
  TempStr = resultArea.Address(RowAbsolute:=False, ColumnAbsolute:=False)
  StrRowNum = 0
  Do While StrRowNum = 0
    StrRowNum = Val(TempStr)
    If StrRowNum = 0 Then
      TempStr = Mid(TempStr, 2, 20)
    End If
    If TempStr = "" Then
      Exit Do
    End If
  Loop
' Determine the Last Row in the spreadsheet where query results are displayed
' The last row will be stored in variable EndRowNum
  TempStr = resultArea.Address(RowAbsolute:=False, ColumnAbsolute:=False)
  StrPos = InStr(TempStr, ":")
  TempStr = Right(TempStr, Len(TempStr) - StrPos)
  EndRowNum = 0
  Do While EndRowNum = 0
    EndRowNum = Val(TempStr)
    If EndRowNum = 0 Then
      TempStr = Mid(TempStr, 2, 20)
    End If
    If TempStr = "" Then
      Exit Do
    End If
  Loop
' Determine the Last Column in the spreadsheet where query results are displayed
' The last column number will be stored in EndColNum
  TempStr = resultArea.Address(RowAbsolute:=False, ColumnAbsolute:=False, ReferenceStyle:=xlR1C1)
  StrPos = InStr(TempStr, ":")
  If StrPos > 0 Then
    TempStr = Right(TempStr, Len(TempStr) - StrPos)
    StrPos = InStr(TempStr, "C")
    If StrPos = 0 Then
      EndColNum = 255
    Else
      TempStr = Right(TempStr, Len(TempStr) - StrPos - 1)
      EndColNum = Val(TempStr)
    End If
  End If
' Clear all of the old contents below the query result area
  TempStr = Format(EndRowNum + 1) + ":" + Format(65536)
  ActiveSheet.Rows(TempStr).Select
  Selection.Clear
' Determine the location of various key figure columns needed in subsequent processing
  KeyFigCol = 0
  For Column = 1 To EndColNum
' Find the start column for the key figures - Indicated by the first column
' with a dash "-" character in it.
    If InStr(resultArea.Cells(1, Column).Value, " - ") <> 0 Then
      If KeyFigCol = 0 Then KeyFigCol = Column
    End If
' Find the Projected Available Column
    If (ColPrjAvl = 0) And (InStr(resultArea.Cells(1, Column).Value, "Proj") <> 0) Then
      ColPrjAvl = Column
    End If
' Find the Top of Green Column
    If (ColTopGrn = 0) And (InStr(resultArea.Cells(1, Column).Value, "Top of Green") <> 0) Then
      ColTopGrn = Column
    End If
' Find the Top of Yellow Column
    If (ColTopYel = 0) And (InStr(resultArea.Cells(1, Column).Value, "Top of Yellow") <> 0) Then
      ColTopYel = Column
    End If
' Find the Top of Red Column
    If (ColTopRed = 0) And (InStr(resultArea.Cells(1, Column).Value, "Top of Red") <> 0) Then
      ColTopRed = Column
    End If
' Find the Recommended Replenishment Quantity
    If (ColRmdRpl = 0) And (InStr(resultArea.Cells(1, Column).Value, "Recommended Replenishment Qty") <> 0) Then
      ColRmdRpl = Column
    End If
' Find the Usage Per Day
    If (UsgPerDay = 0) And (InStr(resultArea.Cells(1, Column).Value, "Usage Per") <> 0) Then
      UsgPerDay = Column
    End If
' Find the Maximum Order Column
    If (ColMaxQty = 0) And (InStr(resultArea.Cells(1, Column).Value, "Maximum Order Quantity") <> 0) Then
      ColMaxQty = Column
    End If
' Find the Recommended Replenishment Column
    If (ColRplQty = 0) And (InStr(resultArea.Cells(1, Column).Value, "Recommended Replenishment") <> 0) Then
      ColRplQty = Column
    End If
  Next Column
'* Begin of main formatting loop
'* Logic for Recommended Repl Highlighting
  If NumPeriods = 0 Then
' Highlight the Recommended Replenishment Quantity
    For RowNum = 2 To EndRowNum
      If resultArea.Cells(RowNum, ColRplQty).Value > resultArea.Cells(RowNum, ColMaxQty).Value Then
           resultArea.Cells(RowNum, ColRplQty).Interior.ColorIndex = 7  'Highlight Red
      End If
    Next RowNum
'* Logic for Monthly and Weekly Queries
  Else
' Work from the bottom up, inserting new lines and folding the keyfigures
' downward into one row for each month
  For RowNum = EndRowNum To 2 Step -1
' Insert blank rows, one to hold each period and one for the total line
    With resultArea.Cells(RowNum, KeyFigCol - 1)  This is where it stops & gives Runtime Error 1004
    If .Value <> "" Then
' For the bottom-most characteristic row, we must cut and paste differently to ensure
' the cells formats are properly pasted in the new rows
    If First Then
      TempStr = Format(RowNum) + ":" + Format(RowNum + NumPeriods)
      resultArea.Rows(TempStr).Select
      Selection.Insert Shift:=xlDown
      resultArea.Rows(RowNum + NumPeriods + 1).Select
      Selection.Cut
      resultArea.Rows(RowNum).Select
      ActiveSheet.Paste
      First = False
' If this is the first characteristic record, and it resides in row 2, then we know that the
' query only has one row of data - special formatting is required in this situation
      If RowNum = 2 Then
        resultArea.Cells(2, 1).Select
        Selection.Copy
        Range(ActiveSheet.Cells(StrRowNum + 2, 1), ActiveSheet.Cells(EndRowNum + NumPeriods, KeyFigCol - 1)).Select
        Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
                               False, Transpose:=False
      End If
' Not the first row, use normal processing
    Else
      TempStr = Format(RowNum + 1) + ":" + Format(RowNum + NumPeriods)
      resultArea.Rows(TempStr).Select
      Selection.Insert Shift:=xlDown
    End If
' As we insert rows for each characteristic row, we need to adjust the end row
' number accordingly
    EndRowNum = EndRowNum + NumPeriods
' Initialize variables used for each set of month processing
    MatMonRow = RowNum + 1
    MonthFlagPrev = ""
    MonthFlag = ""
    MonthColStr = 0
' Scan key figure column headings from left to right, looking for changes in month
    For i = KeyFigCol To EndColNum + 1
' Get the month text for each column
      MonthFlag = ""
      TempStr = resultArea.Cells(1, i).Value
      MonthFlag = Mid(TempStr, InStr(TempStr, "-") + 1, 15)
' If we move into a new month, then copy and paste the previous month downward
      If ((MonthFlag <> MonthFlagPrev) And (MonthFlagPrev <> "")) Or (i = EndColNum + 1) Then
        If DelStrCol = 0 Then DelStrCol = i + 1     ' Capture last key figure of first month
        If i = EndColNum + 1 Then i = i + 1         'For results row, need to extend by one
' Copy and paste values for previous month
        Range(resultArea.Cells(RowNum, MonthColStr), resultArea.Cells(RowNum, i - 1)).Select
        Selection.Copy
        resultArea.Cells(MatMonRow, MonthCol1st).Select
        ActiveSheet.Paste
' Paste the Month text into the row heading
        resultArea.Cells(MatMonRow, MonthCol1st - 1).Value = MonthFlagPrev
        If MonthFlagPrev = " Average Result" Then
          Range(resultArea.Cells(MatMonRow, MonthCol1st - 1), resultArea.Cells(MatMonRow, EndColNum)).Select
          Selection.Interior.ColorIndex = 36
        End If
        With resultArea.Cells(MatMonRow, ColPrjAvl)
        If .Value >= resultArea.Cells(RowNum, ColTopGrn).Value Then
           .Interior.ColorIndex = 43   'Green Green
        ElseIf .Value >= resultArea.Cells(RowNum, ColTopYel).Value Then
           .Interior.ColorIndex = 14   'Green
        ElseIf .Value >= resultArea.Cells(RowNum, ColTopRed).Value Then
           .Interior.ColorIndex = 44   'Yellow
         Else
           .Interior.ColorIndex = 7  'Red
        End If
        End With
        MonthColStr = i
        MatMonRow = MatMonRow + 1
      End If
' Set variables on first pass through
      If MonthColStr = 0 Then
        MonthColStr = i
        MonthCol1st = i
        MonthFlagPrev = MonthFlag
      End If
' Capture the previous month text
      If MonthFlagPrev <> "" Then
        MonthFlagPrev = MonthFlag
      End If
    Next i
' Clear out the key figure data at the lowest characteristic level
    Range(resultArea.Cells(RowNum, KeyFigCol), resultArea.Cells(RowNum, EndColNum)).Select
    Selection.ClearContents
    End If
    End With
    Next RowNum
' Strip out the month text from column headings
    For i = KeyFigCol To DelStrCol
    LabelPos = InStr(resultArea.Cells(1, i).Value, "-")
      If LabelPos > 1 Then resultArea.Cells(1, i).Value = _
                           Left(resultArea.Cells(1, i).Value, LabelPos - 1)
    Next i
' Remove Extraneous columns (months 2-12)
    Range(resultArea.Cells(1, DelStrCol - 1), resultArea.Cells(EndRowNum, EndColNum + 1)).Select
    Selection.Clear
' Format Column Headings with appropriate column widths and heights
    resultArea.Rows(1).Select
    With Selection
        .HorizontalAlignment = xlLeft
        .VerticalAlignment = xlCenter
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 1
        .ShrinkToFit = False
        .MergeCells = False
        .RowHeight = 31.5
    End With
' 001A: Add empty cells for Recommended replenishment
        If ColRmdRpl <> 0 Then
          For i = 2 To EndRowNum
            If resultArea.Cells(i - 1, 1) = "" Then
              Range(resultArea.Cells(i, ColRmdRpl), resultArea.Cells(i, ColRmdRpl + 4)).Insert Shift:=xlToRight
            End If
          Next i
          Columns(ColRmdRpl + 5).Copy
          Range(Columns(ColRmdRpl), Columns(ColRmdRpl + 4)).PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
          Application.CutCopyMode = False                     
        If UsgPerDay <> 0 Then
          For i = 2 To EndRowNum
            If resultArea.Cells(i - 1, 1) = "" Then
               resultArea.Cells(i, UsgPerDay).Insert Shift:=xlToRight
            End If
          Next i
          Columns(ColRmdRpl + 5).Copy
          Range(Columns(ColRmdRpl), Columns(ColRmdRpl + 4)).PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
          Application.CutCopyMode = False
        End If
        For i = 3 To EndRowNum
          If resultArea.Cells(i - 1, 1) <> "" Then
             Range(resultArea.Cells(i, ColRmdRpl + 1), resultArea.Cells(i + NumPeriods - 1, ColRmdRpl + 4)).Select
             Selection.FillDown
             Range(resultArea.Cells(i, UsgPerDay), resultArea.Cells(i + NumPeriods - 1, UsgPerDay)).Select
             Selection.FillDown
          End If
        Next i
' Remove Extraneous columns (months 2-12)
          Range(resultArea.Cells(1, DelStrCol - 1), resultArea.Cells(EndRowNum, EndColNum + 1)).Select
          Selection.Clear
        End If
' 001A: End of new code
    End If
    End If
    Columns("A:BA").ColumnWidth = 10
    resultArea.Columns.AutoFit
' Set Zoom level at 75%
    ActiveWindow.Zoom = 75
' Restore the active cell
    Range(ActiveCellSave).Select
  '  EndTime = Time
  '  MsgBox StartTime
  '  MsgBox EndTime
'   StartTime = EndTime - StartTime
'   MsgBox StartTime
'   End If
'  End If 
'Application.ScreenUpdating = True 
End Sub

Similar Messages

  • Runtime Error '1004':, Method 'Intersect' of object '_Global' failed

    Hello
    I am getting a runtime error 1004, can someone tell me why?  I am getting the runtime error on the first Application.Intercept statement.
    Thank you for your help!
    smsemail
    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    If Not Application.Intersect(Target, Me.Range("A:A")) Is Nothing Then
    lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    If lastRow < 17 Then
    Exit Sub
    End If
    If lastRow > 67 Then
    lastRow = 67
    End If
    Else
    Exit Sub
    End If
    If Not Application.Intersect(Target, Me.Range("A17:A" & lastRow)) Is Nothing Then
    Application.EnableEvents = False
    If Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("A17:A67")) = 0 Then
    Exit Sub
    End If
    If Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("B17:B67")) = 0 And _
    Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("C17:C67")) = 0 And _
    Application.WorksheetFunction.CountA(Worksheets("RIPS").Range("D17:D67")) = 0 Then
    Exit Sub
    End If
    If CmdExecute = True Then
    Exit Sub
    End If
    If CmdClear = True Then
    Exit Sub
    End If
    Worksheets("RIPSSummary").Activate
    lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    Set SourceRange = Application.Intersect(Range("A2:A" & lastRow), ActiveSheet.UsedRange)
    MsgBox "Source Range: " & SourceRange
    Worksheets("RIPS").Activate
    lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    Set TargetRange = Application.Intersect(Range("A17:A" & lastRow), ActiveSheet.UsedRange)
    MsgBox "Target Range: " & TargetRange
    Exit Sub
    wsDeleted = False
    For Each acell In SourceRange.Cells
    RecordFound = True
    If Not IsEmpty(acell.Value) Then
    Set C = TargetRange.Find(acell.Value, LookIn:=x1values)
    If C Is Nothing Then
    RecordFound = False
    End If
    If RecordFound = False Then
    wsDeleted = True
    For Each Worksheet In Worksheets
    If Worksheet.Name = acell.Value Then
    Worksheet.Delete
    End If
    Next Worksheet
    End If
    End If
    Next acell
    If vbKeyDelete Or _
    vbKeyClear Then
    r = lastRow
    Do Until r < 17
    If Worksheets("RIPS").Range("A" & r).Value = "" Then
    Rows(r).Delete
    End If
    r = r - 1
    Loop
    End If
    Application.EnableEvents = True
    End If
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    End Sub

    It should work but maybe there's something about your workbook we can't see.
    In passing generally best not to disable screenupdating, alerts or events unless need to do so. More importantly though you should ensure they always get reset. As written you have several Exit Sub's before any code that resets them. Also in case of an error
    consider resetting them in an error handler.

  • BExAnalyzer: SAPBEXsetFilterValue and others: runtime error 1004, Intersect

    Hello there,
    any idea why e.g. SAPBexSetFilterValue does not work any more in BI7.0?
    We need to set serveral filter values by macro which worked like a charme in BW3.5.
    Now, all functions that have to to with filter values cause a runtime error 1004, saying that the intersect-property of the application object could not be assigned.
    Does anyone have the same problem or even a solution or just a snipplet of working code (set or get a filter value).
    As far as I've found out, the drill-down-functions may cause the same problem.
    Any hints are welcome. Thank you.

    Sure, here it is. Simple enough, but not working no matter what I try:
    Dim result As Long
        ' last parameter (atCell) left out. Cursor placed on filter cell for costcenter. If you have a look
        ' at the API, then the ActiveCell will be used in that case. This worked quite good in BW 3.5
        result = Run("SAPBEXSetFilterValue", "DE00DECCR10000", "0HIER")
        ' The statement above will call the following code inside the API:
        '    Public Function SAPBEXsetFilterValue(intValue As String, Optional hierValue As String, Optional atCell As Range) As Integer
        '      extErrorBegin ("3.x API SAPBEXsetFilterValue called")
        '      If atCell Is Nothing Then Set atCell = Application.ActiveCell
        '      SAPBEXsetFilterValue = paddin.SAPBEXsetFilterValue(ActiveWorkbook.Name, intValue, hierValue, atCell)
        '      extErrorEnd
        '    End Function
        ' No matter if I use my statement (Run(...)) or call the API statement directly, I always receive a runtime error '1004',
        ' saying that the intersect-property of application-object could not be assigned.
    SAPBEXSetFilterValue worked like a charme in BW3.5. We used it in several workbooks for automation and this becomes a really big problem now in BW7.0.
    Any help/idea welcome!

  • Pivot table runtime error 1004

    Hello, i have problem with creating pivot table using vba...this is the code:
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    "Zdroj!R1C1:R" & Pocet & "C5", Version:=xlPivotTableVersion12).CreatePivotTable _
    TableDestination:="Vysledek!R1C1", TableName:="Kontingenční tabulka 2", _
    DefaultVersion:=xlPivotTableVersion12
    every time when i run macro i receive this message: runtime errror 1004...
    Please can you help me solve this issue???
    Thanks a lot...
    Mathew

    You can only run that macro code once - because then you have the pivotcache existing and cannot add the same one again.  Try it this way:
    On Error Resume Next
    ActiveWorkbook.PivotTables("Kontingencní tabulka 2").PivotCache.Delete
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
            "Zdroj!R1C1:R" & pocet & "C5", Version:=xlPivotTableVersion12).CreatePivotTable _
            TableDestination:="Vysledek!R1C1", TableName:="Kontingencní tabulka 2", _
            DefaultVersion:=xlPivotTableVersion12

  • VBA Runtime Error 1004 "Application-defined or Object-defined error"

    I have code VBA code written in MS Access 2010 (.mbd file) to write data into an Excel file (.xls file). Below is the code to write data into that excel file. When you run this code, it always throws Error#1004 "Application-defined or Object-defined
    error". When you debug the code (F8) or run it (F5), it runs absolutely fine with out any issues. I am still not able to figure it out on what exactly the issue is. This code works fine when executed in MS Access 2007.
    Below is thr code that's getting executed and when it fails, the focus is set on the 3rd last line of the code marked in double astriek mark.
    Sub PopulateReport(appExcel As Object, testcam)
    Dim Site As String, intRec As Integer, i As Integer, cnt As Integer, intRecSet As Integer, cntr As Integer
    Dim F1 As String, F2 As String, F3 As String, F4 As String, F5 As String, F6 As String, F7 As String
    Dim F8 As String, F9 As String, F10 As String, F11 As String, F12 As String, F13 As String, CAMDate As Date
    Close
    i = 0
    cnt = 0
    cntr = 0
    Set cnn = CurrentProject.Connection
    rec.Open "SELECT * FROM Site", cnn, adOpenStatic, adLockPessimistic
    rec.MoveLast
    rec.MoveFirst
    intRec = rec.RecordCount
    Do Until cnt = intRec
    rec.MoveLast
    rec.MoveFirst
    rec.Move cnt
    Site = rec(4)
    Select Case Site
    Case "Fort Worth"
    cntr = 0
    recset.Open "SELECT * FROM Employee", cnn, adOpenStatic, adLockPessimistic
    recset.MoveLast
    recset.MoveFirst
    intRecSet = recset.RecordCount
    appExcel.Application.Goto Reference:="START_FW_CL"
    Do Until cntr = intRecSet - 1
    appExcel.Selection.EntireRow.Copy
    appExcel.Selection.EntireRow.Insert
    cntr = cntr + 1
    Loop
    appExcel.Application.CutCopyMode = False
    appExcel.Application.Goto Reference:="START_FW2_CL"
    go = appExcel.Application.Range("START_FW2_CL")
    cntr = 1
    With appExcel.Worksheets("Accts. > Clearing").[START_FW2_CL]
    Do Until recset.EOF
    **.Offset(cntr, 0) = recset(0)**
    .Offset(cntr, 1) = recset(1)
    .Offset(cntr, 2) = recset(2)
    End Sub

    What's wrong about it? It can only copy what you chose to have in the recordset. If you only want some fields or fields in a different order, replace
    SELECT * FROM  with
    SELECT Field1, Field2, etc
    CopyFromRecordset is bay far the best method and runs much faster.
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Runtime Error '1004': Unable to get the DropDowns property of the Worksheet class

    Private Sub SponsorList_Change()
    'On Error GoTo EH
    UnprotectWorksheets
    Application.ScreenUpdating = False
    With ActiveSheet.DropDowns("SponsorList")
    Dim tmpPivotTable As PivotTable
    For Each tmpPivotTable In ActiveSheet.PivotTables
    tmpPivotTable.PivotFields("Sponsor").CurrentPage = .list(.ListIndex)
    Next
    End With
    sponsorUpdateView
    Application.ScreenUpdating = True
    ActiveSheet.Select
    ProtectWorksheets
    Exit Sub
    EH:
    ErrorHandler
    End Sub
    The above code works fine with Excel 2010, but throws the error when executing the "With ActiveSheet.DropDowns("SponsorList")" statement with Excel 2013 (Windows 7 on both machines).  Also works fine with Excel 2013 in debug
    mode.  Help please!

    My testing indicates the line should work fine in xl2013. Have you got the correct worksheet activated? Try ensuring that the correct worksheet is activated by inserting the following code before the problem line.
        Worksheets("Sheet1").Select           'Edit "Sheet1" to the correct sheet name
    Regards, OssieMac

  • Run-time error '1004' Application-Defined or object-defined error

    Hello friends,
    My requirement is to make the cells under Columns Actual, forecast and target (Dimesnion Category) Locked.
    I've used various methods like GetOnlyRange but it didnt work.
    Now, i've selected all the cells of the sheet, where user can input and made them unlocked. ( from Right-click>FormatCells>Protection tab-->Locked checkbox unchecked)
    Then, go to "review" tab, click "Allow Users to edit Ranges",-> Protect Sheet---> ticked "Unlocked Cells"
    Then go to WorkBook Options and set a password for the worksheet.
    But on expand, I'm facing Run-time error '1004' Application-Defined or object-defined error.
    Please help.
    Please help.

    Hi,
    I think that  is VBA Runtime error, you can fix these errors by downloading in various sites.
    http://www.articlesbase.com/data-recovery-articles/vba-runtime-error-1004-application-defined-or-object-defined-error-fix-these-errors--1339060.html
    You can try with the above link.  I hope this could solve your problem.
    Regards,
    B.S.RAGHU

  • IE 8 "Runtime Error" trying to open PDF with Reader 9.5.1

    I've seen many variants of this problem on the forum.  Running Win7, IE 8, Firefox 14, and Reader 9.5.1.
    For some little while, I've had a problem opening PDF files from links on Webpages that I view in IE8.  I see the following Runtime Error message:
    More recently, I've seen a similar problem with Firefox 14.  The difference is that there's no error message with Firefox ... it opens a new tab, but the browser tab remains blank.
    Could the problem be from installing Reader 9.5.1 recently?  How do I back out that update, and resort to the previous version of Reader -- which ran error free?
    Thanks
    Jerry

    We created a small standalone test application, which just opens a PDF. Same issue was found, with just this one User. Here's the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            width="1004" height="510" backgroundColor="#000000" creationComplete="windowedapplication1_creationCompleteHandler(event)">
    <fx:Script>
      <![CDATA[
       import mx.events.FlexEvent;
       protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
        myHtml.location = "vt1_04_using_flash_builder.pdf";
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:HTML id="myHtml" left="10" right="10" top="10" bottom="10"/>
    </s:WindowedApplication>

  • Vba runtime error

    Hi,
    Our workbook has three sheets and each sheet is having one query. i written vba code to remove '#' values. But when i am refresh all the queries at once i am getting the runtime error
    run-time error '1004'
    select method of Range class failed
    How to solve this:
    <b>this is my code:</b>
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
    If queryID = "SAPBEXq0001" Or queryID = "SAPBEXq0002" Or queryID = "SAPBEXq0003" Then
    resultArea.Select
    'Remove '#'
    Selection.Cells.Replace What:="#", Replacement:="", LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
    'Remove 'Not assigned'
    'Selection.Cells.Replace What:="Not assigned", Replacement:="", LookAt:=xlWhole, _ SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
    End If

    Please tell us which line creates the error.
    If it is the
       resultArea.Select?
    If so try following:
    I assume SAPBEXq0001 to be on sheet 1, SAPBEXq0002 on sheet 2, SAPBEXq0003 on sheet 3 for this coding:
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
      Dim SheetNo As Double
      Select Case queryID
        Case "SAPBEXq0001"
          SheetNo = 1
        Case "SAPBEXq0002"
          SheetNo = 2
        Case "SAPBEXq0003"
          SheetNo = 3
        Case Else
          Exit Sub
      End Select
    'Remove '#'
      Sheets(SheetNo).resultArea.Replace What:="#", Replacement:="", _
      LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, _
      MatchByte:=True
    'Remove 'Not assigned'
      Sheets(SheetNo).resultArea.Replace What:="Not assigned", Replacement:="", _
      LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, _
      MatchByte:=True
    End Sub
    hope that helps (and runs, not tested.
    br
    Andreas
    Message was edited by:
            Andreas Hinrichs

  • Runtime error in starting Lightroom

    I receive the following message when I try to start Lightroom:
    Microsoft Visual C++ Runtime Library
    Runtime Error!
    Program:...Files\Adobe\Adobe Photoshop Lightroom 1.2\lightroom.exe
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    Lightroom ran well for several days and then failed to open with the above message.
    I have tried everything I know to do (uninstalled and reinstalled the application, restored the computer to a restore point before Lightroom was originally installed, etc.) and do not know were to go from here. Suggestions would be appreciated.
    I am using Windows XP sp2 and have 4 GB of ram and 250 GB of hard disk space.
    Thanks,
    Cliff Culp

    Aha! A fix! Please look at this...
    http://www.adobeforums.com/cgi-bin
    bob frost, "Help! Runtime error after Lightroom 1.1 install!" #10, 27 Jun 2007 6:54 am

  • Runtime error while executing rule

    Hello All,
      While executing the DTP for a cube, im facing the error as Runtime error while executing rule -> see long text .
      For this source is another Cube, where im loading the data from Cube to Cube.
    Error Description are as follows:-
    Error Location: Object Type    TRFN
    Error Location: Object Name    0T9SCR6Q4VWS1SOPNRRBOY1YD51XJ7PX
    Error Location: Operation Type ROUTINE
    Error Location: Operation Name
    Error Location: Operation ID   00034 0000
    Error Severity                 100
    Original Record: Segment       0001
    Original Record: Number        557
    and Also descripton is :-
    Diagnosis
        An error occurred while executing a transformation rule:
        The exact error message is:
        Division by zero
        The error was triggered at the following point in the program
        GP4H0CW3MLPOTR3E8Y93QZT2YHA 4476
    System Response
        Processing the data record has been terminated.
    Procedure
    The following additional information is included in the higher-level
    node of the monitor:
       Transformation ID
       Data record number of the source record
       Number and name of the rule which produced the error
    Let me know ur valuable suggestions on these error...
    thanks.

    Hello,
    I have checked all the transformation and End Routines.All are working fine.Yesterday i have loaded some data into it, but today its gettting errored out.
    Checked completely in the forum for threads related to this, but couldnt find proper thread which had solutions....
    thanks,
    srinivas.

  • Could someone help me with a Runtime Error while saving a PDF file?

    While saving a 28 page PDF file in Illustrator today, I got a window saying, "This application has requested the "Runtime" to terminate it in a unusual way." It said to contact the applications support team for more information. I keep getting the same thing each time I try it. Does anyone know how to fix this issue or how I contact the applications support team ?
    Thank you for any insight.
    Pam

    It is a 13.5x11 inch calendar. There are 14 pages with images on them and
    some text. The other pages have text, a grid and a colored background with a
    gaussian blur. I saved each page as an "outline".
    The printer I am using requested I save all pages in a pdf file. I was
    successful in saving all but about six pages, now I can't even open the
    file.
    What happens is... I open Illustrator
                                   I open the pdf file
                                   A window appears that says... Runtime Error,
    This application has requested the Runtime to terminate it in an unusual
    way. Please contact the application's support team for more information.
                                   I select ok
                                   then a window appears that says... Adobe
    Illustrator CS5 has stopped working. A problem caused the program to stop
    working correctly. Windows will close the program and notify you if a
    solution is available.
                                   Then the program closes.
    So far I have not been notified of anything.
    Please let me know if you need more details.
    Thank you so much for helping me with this.
    Pam

  • RunTime Error while saving a Sales Order

    Hi All,
    When i am saving a Sales Order, the system is throwing a Runtime Error.
    The ABAP Code in the Runtime Error screen as follows.
              select * from (t681-kotab) appending table <cond_tab>
                     up to 1 rows
                     where kappl  = se_kappl
                     and   kschl  = se_kschl
                     and   datbi >= se_date
                     and   datab <= se_date
                     and   (coding_tab).
    Till these days, there was no such error while saving a Sales Order.
    How to resolve this issue?
    Regards
    Pavan

    Hi,
    The below piece of code is trying to get the contents of the table mentioned in T681-KOTAB.
    select * from (t681-kotab) appending table <cond_tab>
    up to 1 rows
    where kappl = se_kappl
    and kschl = se_kschl
    and datbi >= se_date
    and datab <= se_date
    and (coding_tab).
    The reason could be is someone has screwed up the entries in T681 table. Check that out.
    Try to put a break point on this SELECT query and see what the value of T681-KOTAB holds before the SELECT query. Check whether such a table entry exists in DB.
    Let me know if you are still stuck up.
    If you can send me the ST22 dump of the run time error, i might be able to help you more  on this.
    Hope this helps.
    Thanks,
    Balaji

  • WHILE DELETING A SALE ORDER GETTING A RUNTIME ERROR

    hi to all experts,
    whenever i try to delete a particular sale order im getting a runtime error
    stating that
    Short text
        Screen: Illegal message
    What happened?
        The current screen processing action was terminated since a situat
        occurred where the application could not continue.
        This is probably due to an error in the ABAP program or in the cur
        screen.
    Error analysis
        The program attempted to issue a " " message during "Exit Command" processing.
        This is an illegal operation.
        The program was terminated.
        Screen name.............. "SAPMV45A"
        Screen number............ 4001
    Trigger Location of Runtime Error
        Program                                 SAPMV45A
        Include                                 MV45AFZZ
        Row                                     370
        Module type                             (FORM)
        Module Name                             USEREXIT_SAVE_DOCUMENT
    SourceCde
                  message e001(zm) WITH text-335 ltab-kunnr text-334.
                else.
                  if ktab-jkunnr <> ltab-kunnr.
                    ktab-jkunnr = ltab-kunnr.
                    jobsitecode = ltab-kunnr.
                    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                    EXPORTING
                      input  = jobsitecode
                      IMPORTING
                      output = jobsitecode.
                    SELECT SINGLE * FROM kna1 WHERE kunnr = jobsitecode.
                    IF sy-subrc = 0.
                      ktab-jname1 = kna1-name1.
                      ktab-jstras = kna1-stras.
                    ENDIF.
                    chg_flg = 'X'.
                  endif.
                endif.
              else.
                message e001(zm) WITH text-336.
    * Validation for relationship between Sold-to Party and Ship-to Party
    *          if ktab-ckunnr+0(4) NE ktab-jkunnr+0(4).
    *            message e001(zm) WITH text-335 ktab-jkunnr text-337 ktab-ckunnr.
    *          endif.
              custcode1 = ktab-ckunnr.
              CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = custcode1
                IMPORTING
                  output = custcode1.
              jobsitecode1 = ktab-jkunnr.
              CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = jobsitecode1
                IMPORTING
                  output = jobsitecode1.
              SELECT SINGLE * FROM knvp
              WHERE kunnr = custcode1
                AND vkorg = vbak-vkorg
                AND vtweg = vbak-vtweg
                AND spart = vbak-spart
                AND parvw = 'WE'
    Error analysis
        The program attempted to issue a " " message during "Exit Command"
        This is an illegal operation.
        The program was terminated.
        Screen name.............. "SAPMV45A"
        Screen number............ 4001
    Trigger Location of Runtime Error
        Program                                 SAPMV45A
        Include                                 MV45AFZZ
        Row                                     370
        Module type                             (FORM)
        Module Name                             USEREXIT_SAVE_DOCUMENT

    Hi,
    Seems there is some problem with the user exit USEREXIT_SAVE_DOCUMENT..
    Put a breakpoint and see.
    Regards,
    Nagaraj

  • WHILE DELETING A SALE ORDER GETTING A RUNTIME ERROR " Screen: Illegal message"

    Hi Experts,
    While deleting a sales order giving run time error.  PFB runtime error details.
    If you know any OSS message, please let m know. I tried, but there is no luck.
    Short text
        Screen: Illegal message
    What happened?
        The current screen processing action was terminated since a situation
        occurred where the application could not continue.
        This is probably due to an error in the ABAP program or in the current
        screen.
    What can you do?
        Note which actions and input led to the error.
        For further help in handling the problem, contact your SAP administrator.
        You can use the ABAP dump analysis transaction ST22 to view and manage
        termination messages, in particular for long term reference.
    Error analysis
        The program attempted to issue a " " message during "Exit Command" processing.
        This is an illegal operation.
        The program was terminated.
        Screen name.............. "SAPMV45A"
        Screen number............ 4001
    How to correct the error
        The program must be modified to correct the error.
        The modification must be made in "Exit Command" processing.
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
    Source Code Extract
    Line  SourceCde
        1 *---------------------------------------------------------------------*
        2 *       FORM YVBEP_LESEN                                              *
        3 *---------------------------------------------------------------------*
        4 *       Lesen der Tabelle YVBEP (nicht sortiert)                      *
        5 *---------------------------------------------------------------------*
        6 FORM YVBEP_LESEN USING US_POSNR
        7                        US_ETENR
        8               CHANGING CH_TABIX.
        9
       10   YVBEP = SPACE.
       11   YVBEP-MANDT = VBAK-MANDT.
       12   YVBEP-VBELN = VBAK-VBELN.
       13   YVBEP-POSNR = US_POSNR.
       14   YVBEP-ETENR = US_ETENR.
       15   READ TABLE YVBEP.
       16   IF SY-SUBRC > 0.
       17     MESSAGE E506 WITH US_POSNR US_ETENR.
       18   ENDIF.
    >>>>>   CH_TABIX = SY-TABIX.
       20
       21 ENDFORM.
    Could you please help on this issue.
    Thanks
    Srinu

    Hi Srinu,
    it looks like you got the error message Schedule line &1 &2 is missing in table YVBEP while deleting the sales order.
    It seems, that there are no SAP notes regarding this issue. Do you have this issue with all orders or with a single order?
    If only a single order causes this issue, maybe something was wrong during an update.
    If you get this error for many orders, then custom code (modification, enhancement, user exit in MV45AFZZ, ...) may be the reason for it.
    If you have no custom code in module pool SAPMV45A, then contact SAP for this issue.
    Regards,
    Klaus

Maybe you are looking for