Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Import ascii file

I'm puzzled because I'm trying to figure out a way to
write a macro to import ascii files from instruments into
my worksheets. I would like to be able to type the file
name into a text box and have it automatically import the
data to either a new sheet or existing worksheet. Does
anyone have any hints as to how I may bo about doing this?

Thanks in advance and science thanks you!

Mad Scientist
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Import ascii file

sPath = "C:\My Tools\My Instruments\"
workbooks.Open sPath & Sheet1.Textbox1.Text

--
Regards,
Tom Ogilvy

Mad Scientist wrote in message
...
I'm puzzled because I'm trying to figure out a way to
write a macro to import ascii files from instruments into
my worksheets. I would like to be able to type the file
name into a text box and have it automatically import the
data to either a new sheet or existing worksheet. Does
anyone have any hints as to how I may bo about doing this?

Thanks in advance and science thanks you!

Mad Scientist



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Import ascii file

Try this

Dim sFile as string
sFile$ = Application.GetOpenFilename("Text Files (*.*),*.txt")
If sFile = False Then
End
End If
Workbooks.OpenText FileName:=sFile, Origin:=xlWindows _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(0, 1)
end sub


---
Message posted from http://www.ExcelForum.com/

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
How do I convert an Excel file to an ASCII file? Pugh Excel Discussion (Misc queries) 1 November 8th 06 08:57 PM
Convert a file to an ASCII Pugh Excel Worksheet Functions 1 November 8th 06 07:03 PM
How do I convert an Excel file to an ASCII file? Pugh New Users to Excel 1 November 8th 06 06:57 PM
using data from ascii file? NTaylor Excel Discussion (Misc queries) 2 December 21st 05 04:46 PM
How do I convert excel file into ASCII text file with alignment? Rosaiah Excel Discussion (Misc queries) 2 June 27th 05 12:17 PM


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