Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro opening a file | Excel Programming | |||
Can a macro be run on opening the file? | Excel Discussion (Misc queries) | |||
File opening via Macro with varying file name | Excel Programming | |||
Opening a file with a Macro | Excel Discussion (Misc queries) |