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

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
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 are the differences in the settings?
  #3   Report Post  
Posted to microsoft.public.excel.programming
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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Opening a .csv file thru a macro

On Apr 15, 2:39 pm, wrote:
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



Here is the current code to open the .csv file

Dim FName As Variant
FName = Application.GetOpenFilename("Excel Files (*.csv),*.csv")
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
macro opening a file Leon Excel Programming 1 August 28th 07 02:32 PM
Can a macro be run on opening the file? Cortez Excel Discussion (Misc queries) 3 March 8th 07 08:34 PM
File opening via Macro with varying file name TomFish79 Excel Programming 3 August 15th 05 02:32 PM
Opening a file with a Macro Adam1 Chicago Excel Discussion (Misc queries) 2 February 28th 05 10:13 PM


All times are GMT +1. The time now is 06:23 PM.

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"