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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SENDKEYS Command and Excel file.

Status
Not open for further replies.

ronche

IS-IT--Management
Apr 9, 2002
2
FR
Sorry for my English, I'm a french guy.

I'm looking for how can I use the SendKeys command in a macro file in order to export a cognos report to a excel file with format.
Could anyone please give me an example of that ?

Best regards

Ronan Chenais
 
Hi Ronan,

Are you trying to save using a format other than that which the script editor recognises as an excel file?

In my experience of using sendkeys, I have found a consistency rate of around 95%. That is, the keys sent do not always arrive intact. A filename of 'hello' sent could arrive as 'lo'.

I have found this is particularly bad when trying to use menu functions.

If possible, I would suggest using the standard excel save as with the script editor.


Kevin **************************************************************
The difference between fiction and reality is that fiction has to make sense.
**************************************************************
 
This is right from the Cognos Knowledgebase:
(Doc KB905639CS )

Sub Main

Dim objimp As Object
Dim objrep As Object

Set objimp = CreateObject("Impromptu.Application")
objimp.OpenCatalog "C:\Test\aaa.cat"
Set ImpRep = ObjImp.OpenReport("C:\Test\aaa.imr")
objimp.Visible True

AppActivate "Impromptu - [aaa.imr]"
SendKeys "%F",1
SendKeys "A",1
SendKeys "{TAB}",1
SendKeys "{DOWN 8}",1
SendKeys "{ENTER}",1
SendKeys "+{TAB}",1
SendKeys "D:\test.xls",1
SendKeys "{ENTER}",1

Set objrep = Nothing
Set objimp = Nothing

End Sub

Hope this helps.

Regards,

Dave Griffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top