0

I am using MicroFocus Rumba (VBA Addon) in a VBA project. On the Excel workbook open event, Rumba is opened, and activated (it is declared as a global object). User also opens another instance of Rumba to verify the details.

When "End" is clicked/executed on a Excel Macro, Rumba instance object associated with it gets destroyed. And I need to re-initiate it to be able to run rest of the process. For this purpose I am using GetObject(,"MicroFocus.Rumba") but it does not work and throws an error "ActiveX cant create component", I believe its because Rumba was created in VB??.

Is there any workaround for it? or other approach to capture the active object?.

BigBen
  • 46,229
  • 7
  • 24
  • 40
Samantha
  • 3
  • 1
  • Can't you use `Exit Sub` / `Exit function` statements where `End` is being used instead? By default `End` will kill all variables. If the intention is to really End it where it appears: you need to handle the creation/recreation of the Rumba object using a UDF to check if exists / does not exist – Sgdva May 19 '22 at 16:00
  • @Sgdva - No Exit sub/ function wont help as with "End", user would actually want to stop the processing in the middle and not just exit out. – Samantha May 19 '22 at 16:03
  • Then you would need a UDF instead that checks for the rumba object being set and if not request it/loop through processes and find it again. Another solution may be to save the PID somehow and set the element afterwards with a tweak of [PID](https://www.vbforums.com/showthread.php?765305-How-to-get-Process-ID-from-hwnd) if rumba allows it or has an implementation for it – Sgdva May 19 '22 at 16:15
  • Thank you @Sgdva. Do you have any samples I can refer too?. I have not used PID before nor have I created UDF for RDE objects. – Samantha May 19 '22 at 16:53
  • I attached a discussion about it on my previous comment with notepad as an example, you would need to research to fit it to your rumba instance, however, before going this workaround, I'd strongly suggest that you read Rumba API to set created objects already, most likely there is a method to do so. – Sgdva May 19 '22 at 17:09
  • Hmm I think so too. I have requested for documentation to see if it has any useful tips. – Samantha May 19 '22 at 17:24

0 Answers0