Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default auto open text files

Exploring whether I can create a text file with embedded VBA code that will
allow file to be openned in excel.

Thanks in advance.

--
Michael Maloney
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default auto open text files

Michael

Not sure what you mean. You can save a text file as .csv and it will open
automatically in Excel. You can also record/write a macro opening any other
type of text file with the text import wizard, saving this code to your
personal.xls. This would then always be available to re-run every time XL
was opened

VBA embedded in a text file...no

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Michael Maloney" wrote in
message ...
Exploring whether I can create a text file with embedded VBA code that
will
allow file to be openned in excel.

Thanks in advance.

--
Michael Maloney



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default auto open text files

VBA embedded in a text file...no

follow-up question:

Since name of text file will change every time, can a macro (VBA) be created
to open to most recent (date/time stamp) file in a particular folder?

Thanks again. Mike


"Nick Hodge" wrote:

Michael

Not sure what you mean. You can save a text file as .csv and it will open
automatically in Excel. You can also record/write a macro opening any other
type of text file with the text import wizard, saving this code to your
personal.xls. This would then always be available to re-run every time XL
was opened

VBA embedded in a text file...no

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Michael Maloney" wrote in
message ...
Exploring whether I can create a text file with embedded VBA code that
will
allow file to be openned in excel.

Thanks in advance.

--
Michael Maloney




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default auto open text files

Michael

Does it have to be totally automated in this way. If you just want a
different file fed into the macro each time then at the top (below Sub
xxxxx()) put these lines

Dim sFile As String
sFile = Application.GetOpenFilename(, , "Select an import file")

Then replace the file name you have in the macro with sFile. (Take out the
"" too)

This will now present a box similar to the file open box. It takes the
selection into the sFile variable and uses that in your code. You can
further refine the files it shows in the open dialog box but currently it
shows 'All Files (*.*)'

Let me know how you get on



--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Michael Maloney" wrote in
message ...
VBA embedded in a text file...no

follow-up question:

Since name of text file will change every time, can a macro (VBA) be
created
to open to most recent (date/time stamp) file in a particular folder?

Thanks again. Mike


"Nick Hodge" wrote:

Michael

Not sure what you mean. You can save a text file as .csv and it will
open
automatically in Excel. You can also record/write a macro opening any
other
type of text file with the text import wizard, saving this code to your
personal.xls. This would then always be available to re-run every time
XL
was opened

VBA embedded in a text file...no

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Michael Maloney" wrote in
message ...
Exploring whether I can create a text file with embedded VBA code that
will
allow file to be openned in excel.

Thanks in advance.

--
Michael Maloney






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
Excel v. 2000 won't auto-open later version files aptly10 Excel Discussion (Misc queries) 2 June 18th 08 04:35 AM
2003 sp3 changes how text .xls files open [email protected] Excel Discussion (Misc queries) 3 March 28th 08 01:59 AM
Open several text files using a macro Jade5 Excel Discussion (Misc queries) 0 October 31st 06 02:01 AM
text files open with all data in first column Eileen Excel Discussion (Misc queries) 1 May 10th 05 05:01 PM
open text files as a worksheet clui Excel Programming 1 December 1st 03 11:29 PM


All times are GMT +1. The time now is 06:51 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"