#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel VBA

I've set up a macro in Excel to:

1. Open a .txt file via the Text Import Wizard
2. Copy the data and paste into another worksheet
3. Close the .txt file

Three different Alert Messages pop up:

1. The first indicates the .txt is not in a recognizable format, and if I
want to view anyway..... to which i click 'OK'
2. The second asks if I want to save the .txt file...... 'No'
3. The third asks if I want to move the copied data onto the
clipboard...... 'No'

How do I set up the macro to automatically answer the alerts?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excel VBA

application.DisplayAlerts = False

' your code that raises a message

Application.DisplayAlerts = True

this will suppress most messages - but you will have to test it with your
messages.

--
Regards,
Tom Ogilvy


"gregory" wrote:

I've set up a macro in Excel to:

1. Open a .txt file via the Text Import Wizard
2. Copy the data and paste into another worksheet
3. Close the .txt file

Three different Alert Messages pop up:

1. The first indicates the .txt is not in a recognizable format, and if I
want to view anyway..... to which i click 'OK'
2. The second asks if I want to save the .txt file...... 'No'
3. The third asks if I want to move the copied data onto the
clipboard...... 'No'

How do I set up the macro to automatically answer the alerts?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel VBA

Thanks Tom.



"Tom Ogilvy" wrote:

application.DisplayAlerts = False

' your code that raises a message

Application.DisplayAlerts = True

this will suppress most messages - but you will have to test it with your
messages.

--
Regards,
Tom Ogilvy


"gregory" wrote:

I've set up a macro in Excel to:

1. Open a .txt file via the Text Import Wizard
2. Copy the data and paste into another worksheet
3. Close the .txt file

Three different Alert Messages pop up:

1. The first indicates the .txt is not in a recognizable format, and if I
want to view anyway..... to which i click 'OK'
2. The second asks if I want to save the .txt file...... 'No'
3. The third asks if I want to move the copied data onto the
clipboard...... 'No'

How do I set up the macro to automatically answer the alerts?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Excel VBA

Precede the code with

Application.DisplayAlerts = False

and reset afterwards.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"gregory" wrote in message
...
I've set up a macro in Excel to:

1. Open a .txt file via the Text Import Wizard
2. Copy the data and paste into another worksheet
3. Close the .txt file

Three different Alert Messages pop up:

1. The first indicates the .txt is not in a recognizable format, and if I
want to view anyway..... to which i click 'OK'
2. The second asks if I want to save the .txt file...... 'No'
3. The third asks if I want to move the copied data onto the
clipboard...... 'No'

How do I set up the macro to automatically answer the alerts?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel VBA

Thanks Bob

"Bob Phillips" wrote:

Precede the code with

Application.DisplayAlerts = False

and reset afterwards.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"gregory" wrote in message
...
I've set up a macro in Excel to:

1. Open a .txt file via the Text Import Wizard
2. Copy the data and paste into another worksheet
3. Close the .txt file

Three different Alert Messages pop up:

1. The first indicates the .txt is not in a recognizable format, and if I
want to view anyway..... to which i click 'OK'
2. The second asks if I want to save the .txt file...... 'No'
3. The third asks if I want to move the copied data onto the
clipboard...... 'No'

How do I set up the macro to automatically answer the alerts?







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



All times are GMT +1. The time now is 11:17 AM.

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"