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

Ok I've used the import external data feature to get a text file with all the
core data inserted into my workbook. Unlike the other posts, it's just the
right size. My problem is I have to make this dummy proof for the user.

The text file will always be the same name. In the same directory. On each
computer.

I need to automatically refresh the data without having the message window
come up to select the file. When I record the macro it still gives me the
option of selecting the file. I DON'T need these people having options like
this. (I'm sure you can understand why).

How do I disable the window and tell excel to refresh using the file?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Import Text Issues

The name of the file is always the same on everyone's pc? Including
Drive/folder and filename?

If yes, then just have your macro point at that filename:

Workbooks.OpenText Filename:="C:\My Documents\excel\yourfilename.txt", ....

If the location is set for each user, but can differ between users...

I put a giant button from the forms toolbar on a worksheet.
I give them a cell to type the filename.
Then tell the user to save it with their filename.

The code double checks to see if they did a nice job typing:

dim TestStr as string
teststr = ""
on error resume next
teststr = dir(worksheets("sheet99").range("FileNameCell").va lue
on error go to 0

if teststr = "" then
msgbox "Please fix your typing!
exit sub
end if

====

That way the user doesn't have to search for the file each time (well, after
they've spelled it correctly once).


If this doesn't help, you may want to post the snippet of code that's causing
the trouble.

Jacob_F_Roecker wrote:

Ok I've used the import external data feature to get a text file with all the
core data inserted into my workbook. Unlike the other posts, it's just the
right size. My problem is I have to make this dummy proof for the user.

The text file will always be the same name. In the same directory. On each
computer.

I need to automatically refresh the data without having the message window
come up to select the file. When I record the macro it still gives me the
option of selecting the file. I DON'T need these people having options like
this. (I'm sure you can understand why).

How do I disable the window and tell excel to refresh using the file?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Import Text Issues

Thanks Dave.

Yes, every user has the same filename on the same directory each on their
computer. The data in each txt file changes.

Thanks again!!!

"Dave Peterson" wrote:

The name of the file is always the same on everyone's pc? Including
Drive/folder and filename?

If yes, then just have your macro point at that filename:

Workbooks.OpenText Filename:="C:\My Documents\excel\yourfilename.txt", ....

If the location is set for each user, but can differ between users...

I put a giant button from the forms toolbar on a worksheet.
I give them a cell to type the filename.
Then tell the user to save it with their filename.

The code double checks to see if they did a nice job typing:

dim TestStr as string
teststr = ""
on error resume next
teststr = dir(worksheets("sheet99").range("FileNameCell").va lue
on error go to 0

if teststr = "" then
msgbox "Please fix your typing!
exit sub
end if

====

That way the user doesn't have to search for the file each time (well, after
they've spelled it correctly once).


If this doesn't help, you may want to post the snippet of code that's causing
the trouble.

Jacob_F_Roecker wrote:

Ok I've used the import external data feature to get a text file with all the
core data inserted into my workbook. Unlike the other posts, it's just the
right size. My problem is I have to make this dummy proof for the user.

The text file will always be the same name. In the same directory. On each
computer.

I need to automatically refresh the data without having the message window
come up to select the file. When I record the macro it still gives me the
option of selecting the file. I DON'T need these people having options like
this. (I'm sure you can understand why).

How do I disable the window and tell excel to refresh using the file?


--

Dave Peterson

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
Import Issues PiB311 Excel Worksheet Functions 0 September 14th 09 09:28 PM
Text Issues evoxfan Excel Discussion (Misc queries) 1 July 29th 09 09:18 PM
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
Import External data Formatting issues ridawg Excel Discussion (Misc queries) 0 April 23rd 08 08:45 PM
Export/Import + Copy issues John Keith[_2_] Excel Programming 0 October 21st 05 03:25 PM


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