Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Go Back  Xtreme Visual Basic Talk > > > Time To Move On From VBA to VB .NET


Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2008, 05:47 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline
Out Of Office

Retired Moderator
* Expert *
 
Join Date: Mar 2005
Location: London, UK
Posts: 3,402
Default Time To Move On From VBA to VB .NET


Hi all,

I've been developing in VBA for quite some time and now I've decided that I need to move with the times and tackle VB .NET. To begin with I would particularly like to focus on working with VB. NET and MS Excel 2003/7.

I've got a couple of questions about this transition and I'd be grateful for some advice and feedback.

First of all - what software do I need? I'm a little unclear whether or not I need to get Visual Studio 2005 or VSTO or both? And which edition (Standard / Pro etc..) should I go for?

Secondly - I need a good book. I checked out the recommendations in Tutor's Corner but I'm not sure that they're specifically aimed at this transfer. My Excel VBA is pretty solid - I do it for a job - so I don't want a total beginner's guide - but at the same time I do need something that's going to cover the gaps. I did a couple of searches and appropriate books seem to be:
"VSTO For Mere Mortals: A VBA Developer's Guide to...." by McGrath and Stubbs; or
"Professional VSTO 2005..." by Bruney.

Can anyone give me some guidance on this?

Thanks,
Colin
Reply With Quote
  #2  
Old 02-18-2008, 07:17 AM
XL Jedi XL Jedi is offline
Freshman
 
Join Date: Dec 2007
Location: Palm Beach, Florida
Posts: 26
Default

Just download the Express edition of Visual Studio/vb.net, and you'll have all you need (it's free).
The book I really like is:

Pro VB 2005 and the .NET 2.0 Platform, Andrew Troelsen, (c) 2006 Apress 2nd Ed.

I dabble a bit in VBA myself...
www.XL-Logic.com
Reply With Quote
  #3  
Old 02-18-2008, 08:46 AM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Hey Colin, congratulations on making the move!

(1) My first advice, though, would be to be prepared for a lot of pain. A lot of .NET is really, really nice, but it is a LOT to learn before you will be able to use it in the workplace. If you try and roll it out too fast, your productivity will plummet, and you will get fired -- I promise you.

So be warned.
I am very serious.

That said, you have to start somewhere, so kicking around code on the side and using it for your own projects at first will get you up to speed. When you are ready, you will be able to use it in the workplace.

If you are using Automation -- as opposed to making an in-process add-in -- the first problem you will hit will be the "hanging Excel application" issue. You should have a read of the Automating Office Programs with VB.NET tutorial to help get you started.


(2) I would also advise you to stick with VB.NET, at least for a while. Do NOT be tempted by C#, at least not within your first year or more of .NET development. For what it's worth, I have switched over to C#, and I do prefer it, but for your first year or so development will find it very, very convenient to be able to copy paste code from VBA to/from VB.NET or back. The copy paste will not be 100% viable, but close, with only a little bit of tweaking, the code is essentially identical. To be honest, there may never be a reason to switch over to C#, VB.NET really is much better designed for working with Microsoft Office products such as Excel.


(3) You will need a good VB.NET book in addition to the VSTO book. There is an outstanding VB.NET book by Paul Vick that I think is the best place to start. If you want to get more advanced in VB.NET then look for books by Francesco Balena (but I would start with Paul Vick).

The "VSTO For Mere Mortals" book you mentioned is an outstanding book on VSTO, I highly recommend it.

Also if you don't have it, get the Bullen/Green/Alexander "Excel 2007 VBA" book. It does not touch .NET, but it is the best darned Excel VBA book on the planet, and it has been very nicely updated for Excel 2007.


(4) This is just my opinion, but I think you should think of your development as being (a) Excel 2003 and below versus (b) Excel 2007 and above. The object models are so different with respect to using the CommandBars in Excel 2003 and below versus the Ribbon in Excel 2007 above that you really have to think about them this way.

I know that using .NET tends to make one think in terms of Excel 2003 and above (or maybe Excel 2002 and above in some cases), but this is not a good way to view it.


(5) The next thing to think about is what current solutions you're making will drive the decision about using .NET versus using VSTO -- they are not necessarily the same thing. For example, I have yet to use VSTO to any great degree, but it will be shortly. VSTO's main advantages are the following:

(a) A drag-and-drop Ribbon visual designer that allows you to create a custom Ribbon solution without even having to touch any XML code.

(b) Allows you to utilize standard .NET forms controls within an Excel worksheet.

That's it. But these are big, if you need them.

For me, the second issue is not very important -- I am perfectly happy using standard ActiveX controls on the worksheet, and I very rarely use these kinds of visible-workbook solutions in any case. (I mostly make add-ins that only show their presence through toolbar controls and menus and never display any worksheet or workbook to the user.)

So, for me, the only real reason to use VSTO is to be able to make use of the drag-and-drop Ribbon visual designer -- but for this alone it is worth it. This also means that I will only be using VSTO for Excel 2007 solutions and above, I have no use for it otherwise, and VSTO is not really compatible with versions below Excel 2003.


So I am using .NET for all versions of Excel, but I am only using VSTO for Excel 2007 and above. I also use a smattering of VBA and VB 6.0 in all versions as well -- sometimes these "older" technologies are still useful and can execute far faster, because they do not have to work through the .NET Interop. That is, they execute as COM add-ins natively. Where speed counts, VBA and VB 6.0 is still the way to go.


I hope this helps Colin! This is a very long road... but what I hope you find to be rewarding.

Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb

Last edited by Mike Rosenblum; 02-19-2008 at 04:39 AM.
Reply With Quote
  #4  
Old 02-18-2008, 11:17 AM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Colin,

Most welcome to the world of .NET & Excel Mike has (as always!) given You some excellent input to get You started.

From my point of view it's not about that you will move away from VBA rather to extend your knowledge to also include what .NET offers.

I agree with Mike that VB.NET is the best language to start with together with books that cover .NET Framework, VB.NET and also ADO.NET. To get a good basic knowledge and skill of .NET I would suggest that you create standalone solutions without involving Excel.

VSTO is an advanced topic and without a proper understanding of .NET as well as about Excel object model You will find it hard to develop and deploy VSTO solutions.

The good news is that VSTO is now included in the Professional version and up of VS 2008.

Since I rate this forum as the best .NET & Excel Q&A forum (mainly due to Mike's efforts) you will have a good opportunity to learn more by asking

You may also find the blog VSTO & .NET & Excel to be of interest together with ExcelKB.

Again, welcome to the exciting world of .NET & Excel
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
  #5  
Old 02-18-2008, 01:12 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline
Out Of Office

Retired Moderator
* Expert *
 
Join Date: Mar 2005
Location: London, UK
Posts: 3,402
Default

Wow - thank you all for the information: it really helps a lot! I'd been googling information for ages and I was just getting myself more and more confused.

So.... VB. Net it is for now, with VSTO and possibly C# .Net to follow later down the line.

The advantages of VSTO you outlined seem to be pretty important ones to me. I currently use Office 2007 at home and I am slowly familiarising myself with the Ribbon object model.


If I may, I'd just like to follow up with these questions:-

As far as I can make out (please tell me if I'm wrong!), I could go with XL Jedi's suggestion of downloading the VS 2008 Express Edition for free, or I could go for VS 2008 Pro because it has VSTO included which means I'm sorted for the long run.

Other than licencing (and the price), are there any differences between Visual Studio Pro 2008 and Visual Studio Pro 2008 Academic Edition that a .Net noobie like myself needs to be aware of? If no, then the Pro Academic Edition might be a worthwhile investment over the Express edition?

Well - thanks again and I am sure you will be getting a lot more threads from me on this board once I'm up and running!

Best,
Colin

PS. No fear, I do have the Bullen/Green/Alexander "Excel 2007 VBA" book!
Reply With Quote
  #6  
Old 02-18-2008, 02:25 PM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Colin,

AFAIK, the Express Edition does not include the 'Shared add-in' template for creating managed COM add-ins. I don't know if the Academic Edition includes it or not.

(Yeah, version 3.0 of VSTO which is shipped with VS 2008 is impressive, especially the Visual Ribbon Designer!).
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
  #7  
Old 02-22-2008, 01:47 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline
Out Of Office

Retired Moderator
* Expert *
 
Join Date: Mar 2005
Location: London, UK
Posts: 3,402
Default

Thanks Dennis - I think I'll go for the Pro Academic Edition.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
 
Time To Move On From VBA to VB .NET
Time To Move On From VBA to VB .NET
 
-->