Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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
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
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
Make "Edit" mode default, rather than "Enter"? Greg Boettcher Excel Discussion (Misc queries) 1 July 27th 06 01:46 AM
can I bypass "Windows has encountered a problem" fredashe Excel Discussion (Misc queries) 0 April 15th 06 04:53 PM
How to "bypass" run-time error '91'???? Jeff[_43_] Excel Programming 1 December 13th 04 08:42 PM
Bypass "DISable Macros" Chip R. Excel Programming 2 August 6th 04 06:23 PM


All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"