Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA vs C#

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi all,

I have created a Word template with extensive VBA coding. It uses MailMerge and allows user to create Business-Rules, which get applied to the content while different versions of the document get generated.

After user prepares all the rules, the process that generates various versions runs for about three to four minutes. I am wondering if I write the code in C# and install it on user's machine as a DLL, will it help in reducing the time taken by the process?

Is Dot Net going to use another Interops layer over the Word's internal functions? If so, VBA might be a more efficient that Dot Net?

Could someone throw light on how Dot Net works with Word?

Thanks in advance,
Sheila
 
.net is just a web service API. Nothing to do with word.

Anything that uses Word Objects, will run at the same speed as VBA so there isn't going to be any difference. You can do the same thing in VBScript or Javascript through wsh or even VB or C++. Takes just as long.

Don't think C# will use any interops layer. There is no need to unless someone at MS has screwed up the interface.
 
>.net ... Nothing to do with word

I'm guessing you haven't looked at VSTO ...
 
Visual Studio Tools for Office? The last time I used something like that was when .net was in its infancy and hadn't infected everything. Guess things are different now.

Oh well, disregard my comments.
 
from bitter experience interop is one gigantic PITA. you can control office from .Net but there are so many gotchas that you probably wouldn't want to. unless, of course, you're one of those geeks that enjoys navigating a room full of rotating knives unscathed. satisfying but no way to run a business.

the thing that finally persuaded me against interop was the fact that it's not backwards or forwards compatible. all your weeks of beating your head against the various failings of the object hierarchy will be made useless if you move to a new version of office or visual studio. and god help you if you want to have mixed environments.

stick with vba. it does what it's meant to.

hope this helps,


mr s. <;)

 
Thanks, xwb, strongm, and MisterStick.

MisterStick, the reasons you give for sticking with VBA are clear.

Do you include VSTO in the same basket as interops? One is tempted to consider VSTO because it offers TaskPanes, and some new functionality.

I appreciate your opinions.

Sheila
 
VSTO is also one of the few ways of playing successfully with the ribbon bar in Office 2007 ...
 
i can't say anything about developing in VSTO because all i was doing was firefighting an existing app. didn't seem any different, though.


mr s. <;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top