Consulting

Results 1 to 8 of 8

Thread: excel 2007 stop pop up

  1. #1
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location

    excel 2007 stop pop up

    I have this code that worked great, but now it's giving me a cannot find file. It's supposed to look to see if the file is there if not then just create it without a pop up. This is now in Excel 2007 is there a way I can prevent this pop up?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    And what code is that?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    forgot the code that would help.

    [VBA]Sub SaveAs()
    Dim strFilepath As String
    Dim strSaveAsFile As String, fp As String
    Dim res As String
    Dim wb As Workbook

    strFilepath = "S:\Depot Outgoing 2008\" & _
    Format(Date, "yyyy") & "\" & _
    Format(Date, "mmmm yyyy") & "\" & _
    Format(Date, "mmm dd") & "\"
    Call MakeFolders(strFilepath)

    res = InputBox("What Are Your Initials", "Save Your PS Pim")
    strSaveAsFile = "Pim " & (Format(Date, "mm.dd.yy ")) & res & ".xls"
    On Error Resume Next
    Set wb = Workbooks.Open(strFilepath & strSaveAsFile)
    On Error GoTo 0
    If wb Is Nothing Then
    Set wb = ActiveWorkbook
    wb.SaveAs strFilepath & strSaveAsFile, xlWorkbookNormal
    End If

    End Sub[/VBA]

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Did I give you this code, it looks familiar?

    It all works fine for me in XL2007. Creates a 97-2003 type file, but works.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    It works but it gives me a popup saying can't find file name once you click ok it goes and creates it. I wanted to know if I can avoid the pop up where the user needs to click ok?

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I doesn't give me the popup, and it is coded not too.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    Then I don't understand why it's giving the pop up.

  8. #8
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    It the other part of the code be causing the pop up?

    [VBA]Private Sub MakeFolders(fp As String)
    Dim Dirs As Variant
    Dim tmpDir As String
    Dim i As Long

    Dirs = Split(fp, "\")
    tmpDir = Dirs(0) & Application.PathSeparator
    On Error Resume Next
    For i = LBound(Dirs) + 1 To UBound(Dirs)

    tmpDir = tmpDir & Dirs(i) & Application.PathSeparator
    MkDir tmpDir
    Next i
    End Sub[/VBA]

Posting Permissions

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