3

I can get a reference to a running CorelDRAW X6 application using VBA (in Excel), but only if I explicitly provide an empty string for the Pathname argument...

  'This fails
  Set appCD = GetObject(, "CorelDraw.Application")
  'This works
  Set appCD = GetObject("", "CorelDraw.Application")

Under C#, I'm trying to get CorelDraw using GetActiveObject, but this line appears to fail:

Application = (TApplication)Marshal.GetActiveObject("CorelDraw.Application");

Any ideas on how to get the object?

EDIT: Looks like this question might be the way to go.

4
  • This question doesn't seem to involve vb.net. Perhaps you meant to use the vba tag rather than the vb.net tag (vba and vb.net are not the same). Commented Feb 6, 2016 at 0:36
  • Indeed, I was going to speculate about using VB.Net's GetObject method to get the object, just like VBA's approach, but I decided I didn't really want to go down that road. Commented Feb 6, 2016 at 0:39
  • Then I suggest you remove the vb.net tag. Commented Feb 6, 2016 at 0:41
  • Try this: stackoverflow.com/questions/12926102/… Commented Feb 6, 2016 at 3:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.