.xl01 file type

Kuledoode

New Member
Joined
May 11, 2019
Messages
13
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
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,404
Office Version
365, 2010
Platform
Windows, Mobile
What happens if you change

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

Code:
ActiveWorkbook.SaveAs FileName:=DirFile & File, FileFormat:= 52
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,404
Office Version
365, 2010
Platform
Windows, Mobile
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.
 

Kuledoode

New Member
Joined
May 11, 2019
Messages
13
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
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,739
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 ?
 

Kuledoode

New Member
Joined
May 11, 2019
Messages
13
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
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,404
Office Version
365, 2010
Platform
Windows, Mobile
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:

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,739
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?
 

Kuledoode

New Member
Joined
May 11, 2019
Messages
13
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"
 

Watch MrExcel Video

Forum statistics

Threads
1,095,724
Messages
5,446,145
Members
405,384
Latest member
geowbadyt

This Week's Hot Topics

Top