View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] dgp@dodgeit.com is offline
external usenet poster
 
Posts: 28
Default Opening a .csv file thru a macro

On Apr 15, 2:22 pm, wrote:
I have a macro that starts by displaying the "open file" window so the
user can select a .csv file to be opened and then processed. It works
great in the US. I now have a colleague in Argentina that is
running this macro, and when the csv file is opened all the data is
just stuffed into column A. Normally, it should be spread across
cols. A thru W. To fix this I'd like to be able to either: 1.
tell my Argentinian colleague how to alter her default Excel settings
so that Excel will properly open the csv files on her PC, or, 2.
change the way the macro works so that it automatically displays the
"file open wizard" after she has selected the .csv that is to be
opened. Any Suggestions for how to do either of these options?

Thanks.


What code are you using to open the file?

This method seems to work for me when opening comma delimited text
files, but I'm not sure if language settings might break it:
Workbooks.OpenText Filename:=Path & "\MyTextFile.ext", _
DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False,
Comma:=True _
, Space:=False, Other:=True, OtherChar:="="
Set WbMyFile = ActiveWorkbook