ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text File error message (https://www.excelbanter.com/excel-programming/341561-text-file-error-message.html)

Bafana

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


Tom Ogilvy

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 :confused:


--
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

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 :confused:

--
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

Bafana[_2_]

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



All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com