Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro with 2 date prompts

Status
Not open for further replies.

tyrantlake

Technical User
Jul 2, 2007
2
I'm using Impromptu 7.1. I need help with a macro that will not pass a value into the prompt screen automatically. I have several reports that I need to run every Monday that checks for activity for the previous Friday and Saturday. I have created a macro that can update the first prompt with Friday's date but the other prompt is not getting updated with Saturday's date. Can someone please show me how to correct this issue. Here is the macro that I have:

Sub Main()

Dim objImpApp As object
Dim objImpRep As Object
Dim x
Dim y
Set objImpApp = GetObject("CognosImpromptu.Application")
objImpApp.Visible True
objImpApp.OpenCatalog _
"R:\Impromptu\Sample.cat","User",,,,1
x = Format(Date()-3,"yyyy-mm-dd")
y = Format(Date()-2,"yyyy-mm-dd")
Set objImpRep = _
objImpApp.OpenReport("R:\Report.imr",x|y)
objImpRep.Print ,,
objImpRep.CloseReport
Set objImpApp = Nothing
Set objImpRep = Nothing
End Sub

 
Try substituting

objImpApp.OpenReport("R:\Report.imr",x + "|" + y)

for

objImpApp.OpenReport("R:\Report.imr",x|y)

soi la, soi carré
ymca.gif
 
Thank you drlex for your post. I tried it and it worked..
[2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top