Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing into excel PROBLEMS [email protected] Excel Worksheet Functions 1 January 11th 08 03:01 PM
Importing problems remondrop Excel Discussion (Misc queries) 3 May 25th 07 08:16 PM
problems with importing an image Todd Excel Discussion (Misc queries) 0 January 29th 07 10:10 PM
Problems Importing from Access davey Excel Discussion (Misc queries) 1 July 8th 05 05:47 PM
Problems merging an excel file due to code or file problems? Cindy M -WordMVP- Excel Programming 0 September 14th 04 02:58 PM


All times are GMT +1. The time now is 11:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"