Can VBA jive with C#?

Engineer Joe

Well-known Member
Joined
Jun 10, 2005
Messages
549
I've been messing around with VBA for a while now in excel, and it has been a great benefit. Now I'm interested in getting a little outside of excel, and I've begun to experiment with C#. Does anyone here also work in C#, and if so, do you use it to work within excel, or can you run VBA with C#? I mean, can you find a way to interface between the two (VBA and C#). I'm trying to get an understanding of the potential of applying C# to all of my VBA programming....
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You can't use C# directly in the Office apps -- that's the domain of VBA. However, if you are prepared to stump up the cash (and it's not cheap) you can get VSTO (Visual Studio Tools for Office). VSTO uses an infrastructure that lets you hook into Office apps using any .NET programming language, including C# and VB.Net and it sounds like a good idea, except for the price -- which means that noone I know uses it.

Denis
 
Upvote 0
Note that in Visual Studio 2008 VSTO is included.

If you want to get it free, then you need to sign up for Microsoft events, like Live Launch, where attendees get copies. I got Vista at the last one as well.

I can't guarantee that there will be any more until the next big release though.
 
Upvote 0
You can create add-ins and other .dll files in C# (as well as managed documents if you have VSTO) and call them from Office apps. The migration path to VB.Net would be a lot easier though, IMO.
 
Upvote 0

Forum statistics

Threads
1,216,063
Messages
6,128,559
Members
449,458
Latest member
gillmit

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top