Importing TXT file with Macro displays dialog, how to stop?


Posted by Chris on August 03, 2000 8:02 AM

I am importing a text file that is not .TXT and Excel displays a message on the screen stating non-recognizable format. It imports fine. But I do not want this message displayed.

Question 1) How do I stop the dialog. I have applicaiton.screenupdating=false already.

question 2) I copy and paste between two sheets and get a clipboard message about retaining the memory in the clipboard. How do I stop this also ?

Thanks

Posted by Andrew Lovatt on August 04, 0100 3:37 AM

I don't get this behaviour with Excel 97 using:

Workbooks.OpenText FileName:="C:\WINNT\Profiles\AML1\Desktop\foo.bar", _
Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, Semicolon:=False, _
Comma:=False, Space:=True, Other:=False

where foo.bar is a text file.

Andrew.



Posted by Ivan Moala on August 04, 0100 3:52 AM

Q1.
Application.DisplayAlerts = False
Workbooks.OpenText FileName:="D:\WIP\youfile"

Q2.
Application.cutcopymode=false
after you do a cut & pastes should get rid of this
msg, or application.displayalerts=false


HTH

Ivan