![]() |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 05:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com