Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Excecl VBA: When a Dialog Appears that requires you to press "OK"

In VBA code, how can I handel a Microsoft Office Excel Dialog that pops up?
All I need to do is recogise that the dialog has appeard and press "OK".
--
Thanks
Bruce
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Excecl VBA: When a Dialog Appears that requires you to press "OK"

Try:

Application.DisplayAlerts = False

'run all your code here

Application.DisplayAlerts = True


RBS

"Bruce" wrote in message
...
In VBA code, how can I handel a Microsoft Office Excel Dialog that pops
up?
All I need to do is recogise that the dialog has appeard and press "OK".
--
Thanks
Bruce


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Excecl VBA: When a Dialog Appears that requires you to press "

unfortunately that does not work. If you create a webquery on an Excel page
then disconnect your connection to the internet and then run the query, you
will of course get an error dialog. I am trying to find a way to handle that
error dialog in code. Any ideas???
--
Thanks
Bruce


"RB Smissaert" wrote:

Try:

Application.DisplayAlerts = False

'run all your code here

Application.DisplayAlerts = True


RBS

"Bruce" wrote in message
...
In VBA code, how can I handel a Microsoft Office Excel Dialog that pops
up?
All I need to do is recogise that the dialog has appeard and press "OK".
--
Thanks
Bruce



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Excecl VBA: When a Dialog Appears that requires you to press "

How about:

On Error Resume Next

'line of code causing the error

If Error.Number < 0 Then
'code to handle this error
End If

Otherwise test for a valid connection first and if not present then
do Exit Sub or whatever suitable.


RBS

"Bruce" wrote in message
...
unfortunately that does not work. If you create a webquery on an Excel
page
then disconnect your connection to the internet and then run the query,
you
will of course get an error dialog. I am trying to find a way to handle
that
error dialog in code. Any ideas???
--
Thanks
Bruce


"RB Smissaert" wrote:

Try:

Application.DisplayAlerts = False

'run all your code here

Application.DisplayAlerts = True


RBS

"Bruce" wrote in message
...
In VBA code, how can I handel a Microsoft Office Excel Dialog that pops
up?
All I need to do is recogise that the dialog has appeard and press
"OK".
--
Thanks
Bruce




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excecl VBA: When a Dialog Appears that requires you to press "

Think you will need to test if the connection exists before you try to use it.

--
Regards,
Tom Ogilvy



"Bruce" wrote:

unfortunately that does not work. If you create a webquery on an Excel page
then disconnect your connection to the internet and then run the query, you
will of course get an error dialog. I am trying to find a way to handle that
error dialog in code. Any ideas???
--
Thanks
Bruce


"RB Smissaert" wrote:

Try:

Application.DisplayAlerts = False

'run all your code here

Application.DisplayAlerts = True


RBS

"Bruce" wrote in message
...
In VBA code, how can I handel a Microsoft Office Excel Dialog that pops
up?
All I need to do is recogise that the dialog has appeard and press "OK".
--
Thanks
Bruce



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
Format a cell such that "#NAME?" reads/appears "N/A"? Fred Holmes Excel Discussion (Misc queries) 3 June 18th 09 06:32 AM
Odd error - "This operation requires merged cells..." Maury Markowitz New Users to Excel 3 September 14th 06 01:54 AM
Scroll Bar missing "Control" tab in "Format Properties" dialog box Peter Rooney Excel Discussion (Misc queries) 5 August 24th 06 05:36 PM
"This edit requires a reset!" Error in the VBE jayklmno Excel Programming 0 April 12th 06 11:05 PM
Using "if" equation that requires auto update Boethius1 Excel Discussion (Misc queries) 2 February 6th 06 09:15 PM


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