Results 1 to 3 of 3

Problem Sub Procedure 2007

Threaded View

  1. #1
    Registered User
    Join Date
    02-22-2010
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2007
    Posts
    41

    Problem Sub Procedure 2007

    Hey all,

    I have a sub routine thats crashing 2007 every single time like clockwork, but never crashed 2003.

    Is there anything in this that would tank 2007????

    
    Sub ForceSave()
        Dim FileName As String
        Dim FilePath As String
        Dim WB As Workbook
    
        Select Case Range("cboProperty_Index")
            Case Is < 2
            MsgBox "Please select a Property from the dropdown list.", vbInformation, "Required Value"
            Exit Sub
        End Select
    
    
        Application.ScreenUpdating = False
        
        Set WB = ActiveWorkbook
    
        FileName = "Lease Renewals(" & Range("month") & "-" & Range("year") & ")-" & _
            Range("PropShortName") & "_" & Format(Now(), "m.d.yyyy_hhmmAMPM") & ".xlsm"
        FilePath = "\\File01\shared\IAMC\Properties\" & Range("SaveFolder") & "\Renewals\" & _
            Range("month") & "-" & Range("year") & "\"
        On Error Resume Next
        Kill "U:\" & FileName
        On Error GoTo 0
    
        If Dir(FilePath, vbDirectory) = vbNullString Then
            On Error GoTo Error_Msg
            MkDir (FilePath)
            On Error GoTo 0
        End If
        On Error GoTo Error_Msg
        If Dir(FilePath & FileName) = vbNullString Then
            WB.SaveAs FileName:=FilePath & FileName, FileFormat:=52
        Else
            Application.DisplayAlerts = False
            WB.SaveAs FileName:=FilePath & FileName, FileFormat:=52
            Application.DisplayAlerts = True
        End If
        On Error GoTo 0
        
        On Error Resume Next
        With Sheets("Splash")
            .Shapes("btnSubmit").Cut
            .Visible = False
        End With
        On Error GoTo 0
    
        If FilePath & FileName = vbNullString Then
            WB.SaveAs FileName:=FilePath & FileName, FileFormat:=52
        Else
            Application.DisplayAlerts = False
            WB.SaveAs FileName:=FilePath & FileName, FileFormat:=52
            Application.DisplayAlerts = True
        End If
      
        Workbooks.Open FileName:=FilePath & FileName
    
        ThisWorkbook.Activate
    
        WB.Close SaveChanges:=False
         
        Application.ScreenUpdating = True
    
    Exit Sub
    
    Error_Msg:
            MsgBox "You do not have sufficient priveledges to save this file.", vbCritical, "File Path Error"
            Exit Sub
           
    End Sub
    Last edited by ultimastryder; 06-25-2010 at 08:36 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1