Hi all,
I am after some code that will convert a csv file to an XLS file. I have made a start with the help of some older posts on this forum and elsewhere. Currently I have this:
This does produce a file call PBL.XLS, which is what I'm after, but it's not actually an XLS - it just has that extension.
So what I want to mimmick is the thing that happens if a user opens a csv in Excel, and then save as an XLS by selecting "Excel 97 - 2003 Workbook (*.xls)" from the drop-down list.
Any advice, much appreciated as ever.
I am after some code that will convert a csv file to an XLS file. I have made a start with the help of some older posts on this forum and elsewhere. Currently I have this:
Code:
Sub test2()
strDBPathAndFile = CurrentProject.Path
Dim XLApp As Object
Set XLApp = CreateObject("Excel.Application")
With XLApp
.Application.DisplayAlerts = False
.Workbooks.Open strDBPathAndFile & "\Inputs\PBL.csv"
.ActiveWorkbook.SaveAs strDBPathAndFile & "\Inputs\PBL.xls"
.ActiveWorkbook.Close
.Application.DisplayAlerts = True
End With
End Sub
This does produce a file call PBL.XLS, which is what I'm after, but it's not actually an XLS - it just has that extension.
So what I want to mimmick is the thing that happens if a user opens a csv in Excel, and then save as an XLS by selecting "Excel 97 - 2003 Workbook (*.xls)" from the drop-down list.
Any advice, much appreciated as ever.