#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default OPEN A FILE

JUAN,

GetOpenFilename method will only get the fullpath of your file and assign it
to a variable. In the case of your code it is "fName". Use this variable in
your workbooks.open command

Example;
Workbooks.OpenText Filename:= fName , (put the other arguments here)

Regards,

Jon-jon

"JUAN" wrote in message
...
Hello,
I would like to create a Macro that will open a file,
which could be located anywhere the user saves the file. I
was able to use:
Do
fName = Application.GetOpenFilename
Loop Until fName < True

Which works fine but when I doucle click on a file, it
doesn't open the file. So I know I'm missing more coding.
I need to open the file in Text TAB Delimited which Treat
CONSECUTIVE DELIMETERS as one.
I also used a different code
Workbooks.OpenText Filename:="M:\ZQCMTEST.XLS",
Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=True, Tab:=True,
Semicolon:=False, Comma:=False, _
Space:=False, Other:=False, FieldInfo:=Array(Array
(1, 2), Array(2, 1), Array( _
3, 2), Array(4, 1), Array(5, 1), Array(6, 1), Array
(7, 1), Array(8, 1), Array(9, 1), Array(10 _
, 1))
Which opens a specific file, but since the file location
might be different, I would like for the user to search
for the file and open as tab delimited.
Any help would be very appreciated.
Thanks,
Juan



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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM


All times are GMT +1. The time now is 06:51 AM.

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"