Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems importing a CSV-file
Hi! I have been googleling around for a whole day without coming to conclusion with this issue. I am trying to import a CSV-file (semicolon seperated values). I hav tried and tried with all sollutions I have found but nothing works. I still imports it with all the semicolons and does not seperate th fields. I have tried this: Workbooks.Open "C:\test\Planner.csv", , , , xlCSV, , , , ";" this: Workbooks.Open FileName:=C:\test\Planner.csv, Format:=xlCSV, _ Delimiter:=";", ReadOnly:=True Neither works. I have also tried to change the ";" to the number fo semicolon and that didn't work either. This works: Shell "Excel.exe " & "C:\test\Planner.csv", vbMinimizedNoFocus But the problem is when I open the document this way I dont get th link requiered for my VBA module to work. Please, please, please help a desperate man! /Ro -- ApPojke ----------------------------------------------------------------------- ApPojken's Profile: http://www.excelforum.com/member.php...fo&userid=3251 View this thread: http://www.excelforum.com/showthread.php?threadid=52301 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems importing a CSV-file
Try Workbooks.Opentext function
HTH -- AP "ApPojken" a écrit dans le message de ... Hi! I have been googleling around for a whole day without coming to a conclusion with this issue. I am trying to import a CSV-file (semicolon seperated values). I have tried and tried with all sollutions I have found but nothing works. It still imports it with all the semicolons and does not seperate the fields. I have tried this: Workbooks.Open "C:\test\Planner.csv", , , , xlCSV, , , , ";" this: Workbooks.Open FileName:=C:\test\Planner.csv, Format:=xlCSV, _ Delimiter:=";", ReadOnly:=True Neither works. I have also tried to change the ";" to the number for semicolon and that didn't work either. This works: Shell "Excel.exe " & "C:\test\Planner.csv", vbMinimizedNoFocus But the problem is when I open the document this way I dont get the link requiered for my VBA module to work. Please, please, please help a desperate man! /Rob -- ApPojken ------------------------------------------------------------------------ ApPojken's Profile: http://www.excelforum.com/member.php...o&userid=32516 View this thread: http://www.excelforum.com/showthread...hreadid=523012 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems importing a CSV-file
Like this? Workbooks.OpenText "C:\test\Planner.csv", , 1, , , , , True Still doesn't work -- ApPojke ----------------------------------------------------------------------- ApPojken's Profile: http://www.excelforum.com/member.php...fo&userid=3251 View this thread: http://www.excelforum.com/showthread.php?threadid=52301 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems importing a CSV-file
Rob,
Excel is taking the value from the Regional OptionsNumbersList Separator setting. If this is a ";", the your csv will open as desired. Otherwise, Excel does not consider the ";" as separating anything. The alternative is DataGet External DataImport File. Record a macro when you do that, you will something like: With ActiveSheet.QueryTables.Add(Connection:= "TEXT;C:\PathToFile\SemiColonSeparatedFile.csv ", Destination:=Range("A1")) '........... '........... .TextFileSemicolonDelimiter = True .TextFileColumnDataTypes = Array(1, 1, ... 1, 1) End With NickHK "ApPojken" wrote in message ... Hi! I have been googleling around for a whole day without coming to a conclusion with this issue. I am trying to import a CSV-file (semicolon seperated values). I have tried and tried with all sollutions I have found but nothing works. It still imports it with all the semicolons and does not seperate the fields. I have tried this: Workbooks.Open "C:\test\Planner.csv", , , , xlCSV, , , , ";" this: Workbooks.Open FileName:=C:\test\Planner.csv, Format:=xlCSV, _ Delimiter:=";", ReadOnly:=True Neither works. I have also tried to change the ";" to the number for semicolon and that didn't work either. This works: Shell "Excel.exe " & "C:\test\Planner.csv", vbMinimizedNoFocus But the problem is when I open the document this way I dont get the link requiered for my VBA module to work. Please, please, please help a desperate man! /Rob -- ApPojken ------------------------------------------------------------------------ ApPojken's Profile: http://www.excelforum.com/member.php...o&userid=32516 View this thread: http://www.excelforum.com/showthread...hreadid=523012 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems importing a CSV-file
NickHK - That did the trick! Thanks alot -- ApPojke ----------------------------------------------------------------------- ApPojken's Profile: http://www.excelforum.com/member.php...fo&userid=3251 View this thread: http://www.excelforum.com/showthread.php?threadid=52301 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems importing a CSV-file
The following works by me:
Sub readCSV() Workbooks.OpenText _ Filename:="U:\family2.csv", _ semicolon:=True End Sub HTH -- AP "ApPojken" a écrit dans le message de ... Hi! I have been googleling around for a whole day without coming to a conclusion with this issue. I am trying to import a CSV-file (semicolon seperated values). I have tried and tried with all sollutions I have found but nothing works. It still imports it with all the semicolons and does not seperate the fields. I have tried this: Workbooks.Open "C:\test\Planner.csv", , , , xlCSV, , , , ";" this: Workbooks.Open FileName:=C:\test\Planner.csv, Format:=xlCSV, _ Delimiter:=";", ReadOnly:=True Neither works. I have also tried to change the ";" to the number for semicolon and that didn't work either. This works: Shell "Excel.exe " & "C:\test\Planner.csv", vbMinimizedNoFocus But the problem is when I open the document this way I dont get the link requiered for my VBA module to work. Please, please, please help a desperate man! /Rob -- ApPojken ------------------------------------------------------------------------ ApPojken's Profile: http://www.excelforum.com/member.php...o&userid=32516 View this thread: http://www.excelforum.com/showthread...hreadid=523012 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing into excel PROBLEMS | Excel Worksheet Functions | |||
Importing problems | Excel Discussion (Misc queries) | |||
problems with importing an image | Excel Discussion (Misc queries) | |||
Problems Importing from Access | Excel Discussion (Misc queries) | |||
Problems merging an excel file due to code or file problems? | Excel Programming |