Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: .xl01 file type
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default .xl01 file type

    I have a program that opens an existing workbook, adds a date to the name and saves it as a new file. The code says to save it as a .xlsm file type but it ends up as a .xl01 or a .xl04 or a .xl010 file type. Excel does not recognize this file type when attempting to open in explorer. I cannot find any information on this file type. Please assist!

    Code:
    Sub Check_File()
    
    Dim File As String, DirFile As String
    
    
    File = "Event and Conference Points Table " & Format(ActiveCell, "yyyy-mm-dd" & ".xlsm")
    DirFile = "C:\Users\Jeff\LH Points\"
    
    
    If Dir(DirFile & File) = "" Then
        Workbooks.Open FileName:=DirFile & "Event and Conference Points Table Template.xlsm"
        ActiveWorkbook.SaveAs FileName:=DirFile & File
    Else
        Workbooks.Open FileName:=DirFile & File
    End If
    End Sub
    
    
    Private Sub CommandButton1_Click()  'changes dates back 28 days
        Range("A3").Value = Range("G1")
    End Sub
    
    
    Private Sub CommandButton2_Click()  'changes dates forward 28 days
        Range("A3").Value = Range("H1")
    End Sub
    
    
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Call Check_File
    End Sub

  2. #2
    Board Regular MARK858's Avatar
    Join Date
    Nov 2010
    Location
    Southern England
    Posts
    10,813
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)

    Default Re: .xl01 file type

    What happens if you change

    Code:
    ActiveWorkbook.SaveAs FileName:=DirFile & File
    to

    Code:
    ActiveWorkbook.SaveAs FileName:=DirFile & File, FileFormat:= 52
    Test VBA on a copy of your data (remember you can't normally reverse the action)

    Please follow the forum Rules and Guidelines & please use Code tags around your code i.e. [CODE]your code[/CODE]

    To post a screenshot try one of these links
    MrExcel HTML Maker, RoryA addin (Win & Mac) or Borders-Copy-Paste

  3. #3
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: .xl01 file type

    Still saves as .xl02

  4. #4
    Board Regular MARK858's Avatar
    Join Date
    Nov 2010
    Location
    Southern England
    Posts
    10,813
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)

    Default Re: .xl01 file type

    Before the save line add the line below and copy and paste in the thread what it produces in the Immediate Window.

    Code:
    Debug.Print DirFile & File
    By the way I would change File as a variable name.
    Test VBA on a copy of your data (remember you can't normally reverse the action)

    Please follow the forum Rules and Guidelines & please use Code tags around your code i.e. [CODE]your code[/CODE]

    To post a screenshot try one of these links
    MrExcel HTML Maker, RoryA addin (Win & Mac) or Borders-Copy-Paste

  5. #5
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: .xl01 file type

    From Immediate Window

    C:\Users\Jeff\LH Points\Event and Conference Points Table 2019-05-21.xl05C:\Users\Jeff\LH Points\Event and Conference Points Table 2019-04-30.xl04
    C:\Users\Jeff\LH Points\Event and Conference Points Table 2019-05-17.xl05

  6. #6
    MrExcel MVP
    Join Date
    May 2009
    Posts
    16,098
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    8 Thread(s)

    Default Re: .xl01 file type

    What happens if you change this:
    Code:
    File = "Event and Conference Points Table " & Format(ActiveCell, "yyyy-mm-dd" & ".xlsm")
    to this:
    Code:
    File = "Event and Conference Points Table " & Format(ActiveCell, "yyyy-mm-dd") & ".xlsm"
    and add Mark's change from post #2 ?
    Joe

    When I was a young man I knew everything. Now that I'm older, I realize I know very little, and what I do know, I tend to forget!

  7. #7
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: .xl01 file type

    This:

    File = "Event and Conference Points Table " & Format(ActiveCell, "yyyy-mm-dd" & ".xlsm"
    DirFile = "C:\Users\Jeff\LH Points"


    If Dir(DirFile & File) = "" Then
    Workbooks.Open FileName:=DirFile & "Event and Conference Points Table Template.xlsm"
    Debug.Print DirFile & File
    ActiveWorkbook.SaveAs FileName:=DirFile & File, FileFormat:=52

  8. #8
    Board Regular MARK858's Avatar
    Join Date
    Nov 2010
    Location
    Southern England
    Posts
    10,813
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)

    Default Re: .xl01 file type

    You didn't state whether it saved or not so what happens with the code below?

    Code:
    Sub Check_File()
    
    Dim File As String, DirFile As String
    
    
    File = "Event and Conference Points Table " & Format(Date, "yyyy-mm-dd") & ".xlsm"
    DirFile = "C:\Users\Jeff\LH Points\"
    
    
    If Dir(DirFile & File) = "" Then
        Workbooks.Open Filename:=DirFile & "Event and Conference Points Table Template.xlsm"
        'Debug.Print DirFile & File
        ActiveWorkbook.SaveAs Filename:=DirFile & File, FileFormat:=52
    Else
        Workbooks.Open Filename:=DirFile & File
    End If
    End Sub
    Which is basically what JoeMo put and if it errors try a manual saveas changing the filename to Event and Conference Points Table 2019-05-18 and let us know what message it gives.
    Last edited by MARK858; May 17th, 2019 at 10:08 PM.
    Test VBA on a copy of your data (remember you can't normally reverse the action)

    Please follow the forum Rules and Guidelines & please use Code tags around your code i.e. [CODE]your code[/CODE]

    To post a screenshot try one of these links
    MrExcel HTML Maker, RoryA addin (Win & Mac) or Borders-Copy-Paste

  9. #9
    MrExcel MVP
    Join Date
    May 2009
    Posts
    16,098
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    8 Thread(s)

    Default Re: .xl01 file type

    You're missing a close parentheses on the File line. And what does Debug.Print DirFile & File produce in the Immediate Window after you fix the File line?
    Joe

    When I was a young man I knew everything. Now that I'm older, I realize I know very little, and what I do know, I tend to forget!

  10. #10
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: .xl01 file type

    This Works
    Thanks 1 000 000 for helping out a beginner

    Code:
    File = "Event and Conference Points Table " & Format(ActiveCell, "yyyy-mm-dd") & ".xlsm"DirFile = "C:\Users\Jeff\LH Points\"
    
    
    If Dir(DirFile & File) = "" Then
        Workbooks.Open FileName:=DirFile & "Event and Conference Points Table Template.xlsm"
        ActiveWorkbook.SaveAs FileName:=DirFile & File, FileFormat:=52
    Now the only thing I have to get is the date of the newly created file to show up in cell A2
    File = "Event and Conference Points Table " & Format(ActiveCell, "yyyy-mm-dd") & ".xlsm"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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