Hi,
I’m working on some code in LotusScript to gather some data from a database, send it to Excel and have the user interact with an Excel userform, and then have the results returned to my script. The userform is stored in an Excel file on my computer. Everything works OK, but the problem is that when I open the userform, the user has to hit Alt-Tab to see it. How can I programmatically bring the userform to the front of the screen? Also, once the user clicks OK on the userform, ideally the focus should return to Lotus, but instead it goes to Excel.
Any ideas on bringing Excel to the front, and then bringing Lotus back to the front?
Thanks!
Here’s the part of my code that deals with Excel:
Dim xlapp As Variant
Dim retval As Variant
Set xlapp = GetObject(“”,“Excel.Application”)
xlapp.workbooks.open(“C:.…\To Be Opened By Lotus.xls”)
xlapp.run “ShowUserform”, retval 'retval is passed ByRef and holds the return value
xlapp.workbooks(“To Be Opened By Lotus.xls”).close
Msgbox retval(0)