CreativeSE

Which is a better application to use if the application has to interface with Excel A LOT

What are the pros and cons of both

I've used Visual Basic but haven't used Visual C++ with Excel



Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

Douglas H. Troy

Doesn't really matter, frankly, use the tool that you know, unless you have a specific reason for moving. You're not going to 'gain' anything by moving to C++, in the context of Excel automation; frankly, if anything, you would have a massive loss of productivity, since you've never used C++ before, which means you'd have to learn the language, framework, COM, etc.. in order to implement your solution ...

C++ isn't a language that you just "switch to" ... it is no where near anything like VB; at all.

But as I already stated, you're not going to gain any real advantage by moving to C++ just for an Excel solution.





Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

CreativeSE

I've programmed in the C++ language for several years but only on a Unix platform. I haven't used the Visual Studio tool for it. Using the language is easy for me but I wasn't sure about the automation features that C++ has to offer for Excel.

I just wanted to know if I'll be able to do the same Excel automation functions in Visual C++ as I would in Visual Basic.





Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

Douglas H. Troy

Sorry about that, they way you worded your original posting, obviously, led me to believe you had not.

I've never run into any issues using C++ to automate either Word or Excel. Obviously, dealing with COM, you have to jump through more hoops than in VB, but it's the same.

You're not going to get the nice object inspector stuff, and you'll have to suffer the MSDN to find references for the object model and whatnot ... and of course, all the examples out there are either VB or now, .NET ...

I'm not making this sound very appealing, am I

Smile





Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

CreativeSE

Yeah I realized that I needed to reword the question. All of the examples I've seen are for VB as well. I was kind of hoping to not use VB for a little while because I want to exercise my C/C++ skills as much as possible since learning/doing VB is like riding a bike.

Don't worry. No one is making it appealing so you are not alone.





Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

Douglas H. Troy

Well, obviously, using C++ you'll gain the speed, power and size:

If you don't use the MFC, and stick with ATL and, if you require some kind of front-end use WTL, you'll also gain the benefit of a small foot print; don't get me wrong, MFC is fine, but then you have the runtime to distribute and deal with. You can use the Boost library for Smart Pointers, or roll your own, and that'll help prevent memory leaks, and failure of releasing ref counts on your COM objects, etc...

But expect your development time to increase ... that's the trade off, frankly.

... really depends on what you're wanting to do, and your requirements ... like everything else ...








Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

CreativeSE

Thank you so much for your help. I think because of time constraints, I may just stick with Visual Basic.



Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

Cindy Meister

CreativeSE wrote:

I've programmed in the C++ language for several years but only on a Unix platform. I haven't used the Visual Studio tool for it. Using the language is easy for me but I wasn't sure about the automation features that C++ has to offer for Excel.

I just wanted to know if I'll be able to do the same Excel automation functions in Visual C++ as I would in Visual Basic.

There's another factor you may want to look at. Excel has an API for C++. I've no idea what advantages that may have, although I suspect that execution of the actual automation may be significantly faster than going over the .NET interface. Best place to ask would be the excel.programming newsgroup. The Excel specialists there may be able to give you more detailed information.






Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

Maarten van Stam

I have been doing programming Office applications a lot in C++ years ago and I can tell you that you -don't- want to do that if it is not really necessary. The Office Object Model is much easier to use in Visual Basic.

Today I do most things in C# because I just like the C feel of it and you can program C# somewhat similar to VB.NET. One of the downsides is the 'no optional parameters' issue in C#, but you get used to that.

So my choice would be, don't start with C++ if you don't have to ... go straight to C#/VB.NET if you are in the position.

-= Maarten =-






Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

CreativeSE

Cindy Meister wrote:
CreativeSE wrote:

I've programmed in the C++ language for several years but only on a Unix platform. I haven't used the Visual Studio tool for it. Using the language is easy for me but I wasn't sure about the automation features that C++ has to offer for Excel.

I just wanted to know if I'll be able to do the same Excel automation functions in Visual C++ as I would in Visual Basic.

There's another factor you may want to look at. Excel has an API for C++. I've no idea what advantages that may have, although I suspect that execution of the actual automation may be significantly faster than going over the .NET interface. Best place to ask would be the excel.programming newsgroup. The Excel specialists there may be able to give you more detailed information.

Thanks, Cindy. I going to check out the Excel Programming Newsgroup.





Re: Visual Studio Tools for Office Visual Basic vs. Visual C++

CreativeSE

I'm not very familiar with C# but I've definitely heard a lot about it. I will look into C# for other projects. I think I will be using VB.NET.