In VBA I can terminate execution of macros using an End statement as follows.
Sub DoSomeThing()
Dim test As Boolean
test = false
test = function()
If test Then
End 'Macro execution is terminated
End if
End Sub
I would like my C# DLL to contain a method that has the same effect? I am thinking of something along the following line.
public void DoSomething_CSharp()
{
var test = false;
test = Function();
if (test)
{
//Call a command here that terminates execution of the VBA macro that calls this method.
}
}
I realize the End is a VBA statement, but I don't know how to reach VBA statements from within a C# DLL. (As this question demonstrates, I am new to C#.)