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


I have set up a macro to import multiple text files. When opening th
text file(s) the following error/warning msg appears -"This file is no
a recognisable format"-. The macro then suspends until you select "OK
on the msg.

Is there any way to avoid having to press "Enter" (i.e. to select "OK"
as I am getting a bit fustrated "OK"-ing about 50 times (the number o
text files) each time I import.

Tx :confused

--
Bafan
-----------------------------------------------------------------------
Bafana's Profile: http://www.excelforum.com/member.php...fo&userid=2769
View this thread: http://www.excelforum.com/showthread.php?threadid=47208

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Text File error message

the easiest might be to make the textfile in a format that is recognizable.
I haven't run across a true textfile that causes this prompt.

--
Regards,
Tom Ogilvy


"Bafana" wrote in
message ...

I have set up a macro to import multiple text files. When opening the
text file(s) the following error/warning msg appears -"This file is not
a recognisable format"-. The macro then suspends until you select "OK"
on the msg.

Is there any way to avoid having to press "Enter" (i.e. to select "OK")
as I am getting a bit fustrated "OK"-ing about 50 times (the number of
text files) each time I import.

Tx


--
Bafana
------------------------------------------------------------------------
Bafana's Profile:

http://www.excelforum.com/member.php...o&userid=27693
View this thread: http://www.excelforum.com/showthread...hreadid=472082



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Text File error message

Try turning off alerts:

Application.DisplayAlerts = False
Workbooks.OpenText ............
Application.DisplayAlerts = True

I've seen this when I downloaded reports from the mainframe and the first
character in the file was a new page (Hex 0C) (from an FBA dataset).

If you're doing the same thing, you may want to go back and download an FB
version of the file--then you can just ignore column 1).

(or remove all the characters from column 1 while you're on the mainframe.)

Bafana wrote:

I have set up a macro to import multiple text files. When opening the
text file(s) the following error/warning msg appears -"This file is not
a recognisable format"-. The macro then suspends until you select "OK"
on the msg.

Is there any way to avoid having to press "Enter" (i.e. to select "OK")
as I am getting a bit fustrated "OK"-ing about 50 times (the number of
text files) each time I import.

Tx

--
Bafana
------------------------------------------------------------------------
Bafana's Profile: http://www.excelforum.com/member.php...o&userid=27693
View this thread: http://www.excelforum.com/showthread...hreadid=472082


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Text File error message


Tx Dave, you were spot on re the source of the data - unfortunately we
are at a remote location and access the data via an existing utility -
to get anything changed is not really an option.

But your 'DisplayAlerts' option worked - thats my new lesson for the
day.

Cheers


--
Bafana
------------------------------------------------------------------------
Bafana's Profile: http://www.excelforum.com/member.php...o&userid=27693
View this thread: http://www.excelforum.com/showthread...hreadid=472082

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
file format or file extension is not valid...error message Ballun Excel Discussion (Misc queries) 0 May 7th 09 09:06 PM
Error message when using Excel to open text file orutulsa Excel Discussion (Misc queries) 2 March 14th 06 06:10 PM
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. Tim Marsden Charts and Charting in Excel 2 October 15th 05 02:10 PM
open file file then error message Piroon Saetang Excel Discussion (Misc queries) 1 February 4th 05 12:05 AM
Error message when opening file Chrissy Excel Programming 1 December 22nd 04 05:51 PM


All times are GMT +1. The time now is 03:39 PM.

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"