Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to bypass "Enter Parameter Value" via macros
I have a simple macro to Generate a Report that I will use for several
databases; however, I have certain datafields that are present in some databases and not others -- which is okay. My issue is when executing the report macro on a database that does not have these datafields, I get a separate popup window ("Enter Parameter Value"). If I don't enter anything and manually click "Okay", the macro will complete the remaining steps and generate the report. Question - What can I do to have the Macro click "Okay" and complete the remaining steps. My goal is to bypass the manual click of "Okay". |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to bypass "Enter Parameter Value" via macros
There are a number of scripts out there that will answer a question like this
but they are all work arounds with time delays and such. I would say that your best bet is to write queries for each different database to avoid the question in the first place. Here is some code to send the "y" key to Outlook Dim fso As Object Dim fsoFile As Variant Dim wshShell As Variant Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem On Error GoTo ErrorHandler Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) Set fso = CreateObject("Scripting.filesystemobject") Set fsoFile = fso.createtextfile("Bypass.vbs") fsoFile.writeline "Set fso = Createobject(""Wscript.shell"")" fsoFile.writeline "While fso.appactivate(""Microsoft outlook"") = false" fsoFile.writeline "wscript.sleep 1000" fsoFile.writeline "Wend" fsoFile.writeline "fso.sendkeys ""a"", true" fsoFile.writeline "fso.sendkeys ""y"", true" fsoFile.writeline "wscript.sleep 7000" fsoFile.writeline "while fso.appactivate (""microsoft outlook"") = false" fsoFile.writeline "wscript.sleep 1000" fsoFile.writeline "wend" fsoFile.writeline "fso.sendkeys ""y"", true" fsoFile.Close .. .. .. Set wshShell = CreateObject("Wscript.Shell") wshShell.Run ("bypass.vbs") "Jeff" wrote: I have a simple macro to Generate a Report that I will use for several databases; however, I have certain datafields that are present in some databases and not others -- which is okay. My issue is when executing the report macro on a database that does not have these datafields, I get a separate popup window ("Enter Parameter Value"). If I don't enter anything and manually click "Okay", the macro will complete the remaining steps and generate the report. Question - What can I do to have the Macro click "Okay" and complete the remaining steps. My goal is to bypass the manual click of "Okay". |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to bypass "Enter Parameter Value" via macros
You could try just a sendkey depending on your circumstances.
"Jeff" wrote: I have a simple macro to Generate a Report that I will use for several databases; however, I have certain datafields that are present in some databases and not others -- which is okay. My issue is when executing the report macro on a database that does not have these datafields, I get a separate popup window ("Enter Parameter Value"). If I don't enter anything and manually click "Okay", the macro will complete the remaining steps and generate the report. Question - What can I do to have the Macro click "Okay" and complete the remaining steps. My goal is to bypass the manual click of "Okay". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! | Excel Discussion (Misc queries) | |||
Make "Edit" mode default, rather than "Enter"? | Excel Discussion (Misc queries) | |||
can I bypass "Windows has encountered a problem" | Excel Discussion (Misc queries) | |||
How to "bypass" run-time error '91'???? | Excel Programming | |||
Bypass "DISable Macros" | Excel Programming |