cancel
Showing results for 
Search instead for 
Did you mean: 

VBA Macro Behaves differently between Control Room and Test Process

JasonNikowitz
Level 2
Sorry if this is being posted to the wrong forum, I wasn't sure of the appropriate location.         I'm having an issue where a VBA Macro that is called by my process behaves differently if it is run from the Test Process environment vs. the Control Room.  I'm looking to find some guidance on what could be causing this difference of behavior.         For some more details, I'm using a VBA macro that lives in an Excel file to send an e-mail from an Outlook account.  Specifically:         Blue Prism process obtains information for said e-mail Blue Prism opens excel and runs the 'Send_Email' VBA Macro VBA Macro (from excel) creates an Outlook object, VBA Macro builds a message using Outlook object VBA Macro  sends message Blue Prism continues with the rest of process       The reason I'm using Excel VBA to send an e-mail instead of Blue Prism direct is that we ran into security/permissions issues (on our side, not BP's) that didn't allow Blue Prism to robotically send e-mails directly from Outlook.  Apparently IT/Security is fine with us sending automated e-mails via VBA (*shrug*).         I'm using a modified Excel VBO that contains a "Call Macro" task.  It is a part of many other successful BP Processes I run, and it is successfully calling the VBA macro in this specific process, so I'm fairly confident that is not the source of my issue.         Below is the relevant VBA code from the Send_Email macro:               Dim Outlook As Object           Dim Message As Object           Set Outlook = CreateObject("Outlook.Application")           Set Message = Outlook.CreateItem(0)       When the macro errors, it is on the 'Set Outlook..." line of the code (step 3 above) and provides the error 'Error 429 - ActiveX component can't create object'         Now normally I wouldn't assume that a VBA error should be addressed in the Blue Prism forums, but here's the curious thing:  This macro error only occurs when the process in run from the Control Room.  If I run the process in the Test Process environment or if I run the macro manually, it runs successfully.         So my main question is: What could possibly be different between the Test Process and Control Room runs that would cause this macro to behave differently?  Has anyone run into something like this before?  Does anyone have suggestions for solutions or future debugging?         Thanks in advance!
1 REPLY 1

JasonNikowitz
Level 2
Just a follow up, I was able to solve (or at least develop a work around) for this issue.  If I initially run Outlook as an administrator, then the macro runs as intended.   This doesn't explain why the process/macro initially would work using Test Process and not Control Room, but it does render that issue/concern moot for this specific process.