ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   opening CSV file in Excel 2010 from VBA (https://www.excelbanter.com/excel-discussion-misc-queries/270616-opening-csv-file-excel-2010-vba.html)

Sonnich Jensen

opening CSV file in Excel 2010 from VBA
 
Hi

This should work

Workbooks.Open Filename, Format:=4, Delimiter:=";"

but it opens so, that all my semicolon separated text is on on coloumn
- what do I do wrong?

Sonnich

James Ravenswood

opening CSV file in Excel 2010 from VBA
 
On Oct 25, 8:01*am, Sonnich Jensen wrote:
Hi

This should work

* * Workbooks.Open Filename, Format:=4, Delimiter:=";"

but it opens so, that all my semicolon separated text is on on coloumn
- what do I do wrong?

Sonnich


I tried your code using Excel 2007 and it worked perfectly:

Sub Sonnich()
Dim Filename As String
Filename = "C:\TestFolder\test.txt"
Workbooks.Open Filename, Format:=4, Delimiter:=";"
End Sub


All times are GMT +1. The time now is 10:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com