Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
oli oli is offline
external usenet poster
 
Posts: 1
Default Opening a csv file


Hello,

I have som trouble by opening a csv file: if I do it normally in Exce
with File/Open, then it works fine and I get the date in 4 column
(AbJahrMonat in A, Code in B, Name in C and Wert in D):

AbJahrMonat Code Name Wert
200507 P01 Produkt1 0,0225

I registred the generated macro, it looks like this:
die entsrechende Makro habe ich registriert, es sieht so aus:

Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 05/10/2005 par Olivier
'

'
ChDir "C:\temp"
Workbooks.Open Filename:="C:\temp\myfile.csv"
End Sub

After the registration, if I run the macro, for example with F5, the
it doesn't work the way I wish; it looks like this (everything i
column A):

AbJahrMonat;Code;Name;Wert;
200507;P01;Produkt1;0 0225;

How can I do to automatically get the data in 4 columns by open ?

Thanks you.

Olivier


:confused

--
ol
-----------------------------------------------------------------------
oli's Profile: http://www.excelforum.com/member.php...fo&userid=2400
View this thread: http://www.excelforum.com/showthread.php?threadid=47367

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Opening a csv file

Workbooks.Open "C:\temp\myfile.csv", 2

this is very clear in HELP on the workbook OPEN item. The second parameter
is the format.

"oli" wrote:


Hello,

I have som trouble by opening a csv file: if I do it normally in Excel
with File/Open, then it works fine and I get the date in 4 columns
(AbJahrMonat in A, Code in B, Name in C and Wert in D):

AbJahrMonat Code Name Wert
200507 P01 Produkt1 0,0225

I registred the generated macro, it looks like this:
die entsrechende Makro habe ich registriert, es sieht so aus:

Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 05/10/2005 par Olivier
'

'
ChDir "C:\temp"
Workbooks.Open Filename:="C:\temp\myfile.csv"
End Sub

After the registration, if I run the macro, for example with F5, then
it doesn't work the way I wish; it looks like this (everything in
column A):

AbJahrMonat;Code;Name;Wert;
200507;P01;Produkt1;0 0225;

How can I do to automatically get the data in 4 columns by open ?

Thanks you.

Olivier





--
oli
------------------------------------------------------------------------
oli's Profile: http://www.excelforum.com/member.php...o&userid=24000
View this thread: http://www.excelforum.com/showthread...hreadid=473677


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
Opening file in Excel 2003 opens multipule instances of same file Ed_B Excel Discussion (Misc queries) 1 June 21st 07 07:10 PM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
Error:Invalid File format,while opening an Excel Template file Saurabh Excel Programming 1 January 17th 05 07:15 AM


All times are GMT +1. The time now is 04:56 PM.

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

About Us

"It's about Microsoft Excel"