Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    May 2001
    Location
    Omaha, NE USA, Nebraska, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Runtime error 438 (Office 2007 SP1)

    I have listed below a section of code that I was using successfully in Excel 2003 for years, but when I run this under Excel 2007 I get a 'runtime error 438 Object doesn't support this property or method' error. The de###### points to the code listed in red. Any ideas on why this won't work.

    <pre>Private Sub ConvertHours_May05()
    Dim strMsg As String, strQuestion As String
    Dim rowNum As Long, strPlace As String
    Dim rowNum2 As Long, strPlace2 As String
    Dim rowNum3 As Long, strDelRng3 As String
    Dim ndate As String
    ndate = Format((Date) - 2, "mmddyy")
    strMsg = "What is the name of the export file?" & vbCrLf & _
    vbCrLf & "(Must include the '.xls' extension)"
    strQuestion = InputBox(strMsg, "QuickHit.xla", "HRS" & ndate & ".XLS")
    If strQuestion = "" Then
    End
    End If
    Windows(strQuestion).Activate
    Sheets("SubTotals").Activate
    rowNum = ActiveSheet.UsedRange.Rows.count
    strPlace = "2:" & rowNum
    Rows(strPlace).Copy
    Windows("DailyPayableTime.xls").Activate
    rowNum2 = ActiveSheet.UsedRange.Rows.count
    strPlace2 = rowNum2 + 1
    <font color=red>Rows(strPlace2).Insert Shift:=xlDown</font color=red>
    Application.CutCopyMode = False
    rowNum3 = ActiveSheet.UsedRange.Rows.count
    strDelRng3 = rowNum3 + 1 & ":65536"
    Rows(strDelRng3).Delete Shift:=xlUp
    Columns("R:IV").Delete
    ActiveWorkbook.Save
    Windows(strQuestion).Activate
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    End Sub

    </pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Runtime error 438 (Office 2007 SP1)

    There doesn't seem to be any point in inserting a row below the last used row, but does it work better if you use

    Range("A" & strPlace2).EntireRow.Insert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •