3

I have been checking around as to whether I can use .NET regex balancing groups in an excel spreadsheet VBA function.

However, it appears that VBA is not compatible with, nor is it a part of .NET. For example, wikipedia bluntly states that "VBA is incompatible with Visual Basic .NET (VB.NET)".

So, just to be sure, w/r/t regex balancing groups, I'm out of luck in VBA, correct?

Kris van der Mast
  • 16,343
  • 8
  • 39
  • 61
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213

2 Answers2

5

There's nothing wrong with writing a .NET object, exposing it to COM and using it from VBA.

"Incompatible" probably means the .NET code, pasted into a VBA editor, will not work.

GSerg
  • 76,472
  • 17
  • 159
  • 346
5

You can actually use .Net to create Visual Studio solutions since at least Office 2003 using Visual Studio Tools for Office (VSTO).

Unfortunately, you have to jump through a couple of hoops and adhere to some restrictions to get it deployed, but it could potentially be easier than exposing and registering a COM object. This MSDN article has some good information about creation and deployment of VSTO solutions.

competent_tech
  • 44,465
  • 11
  • 90
  • 113