Converting VB6 application Vb.Net using Interop - interop

I have a fairly large application, written in VB6. I want to convert it to Vb.Net using Interop, but donot know how to do it.
The application is so big that I really can't re-write it in VB.Net.
Thanks and best regards,
Furqan

Related

Using Visual Studio Instead of Built in VBA Editor

I'm looking for an explanation as to what I can and can't do as well as advantages and disadvantages to using Visual Studio for coding instead of the built in text editor in Excel.
From my perspective
Use VBA editor (VBE) if you
develop ad-hoc apps for yourself, friends
are the only one who works on a project
mainly works with the Office object model - no communicating with System, Web, database etc.
don't use source control (Note: Rubberduck is here to help if you do so)
don't include too many dlls from the Reference form
don't want to learn new platform (.NET)
Note, I did all the above and I could live with just VBA for long time without too many problems and in a few ways VBA is much better than VSTO e.g. in debugging (here I mean, you can change almost everything when you are debugging VBA and you'll be still able to continue, there is no way to do the same in VSTO)
Use VSTO if you
want to better support for System, Web, XML, database tasks. NET is
much more better especially if we're talking about web or database
stuff
want to have better support (sometime out of box) for version control
(GIT, SVN, TFS, Perforce)
don't won't to have problems with dependencies (this could be
actually painful as well)
want to use new VSTO objects like NamedRange incl. events
want to learn new platform
I remember myself a few years ago when I thought VSTO brigs something new to Office object model, and it doesn't if you don't count the VSTO objects. So if you're heavily working with just Excel object model (manipulating with ranges, sheets, workbooks, calculating) you can still live with VBA only.
I also remember that with VSTO you can't easily create UDF (custom function)
Also seems like that MS is not going to invest too much effort to add/update/improve VSTO, they rather focus on Office API
VSTO blog - comments
Thanks for your question Ben, we have already publically announced that we will not be turning off VSTO or VBA in the next version of Office. All of our new investments are in Apps for Office and Apps for SharePoint and making the Office 365 APIs more robust. We will not be making any future investments in VSTO or VBA
It might look like I'm against VSTO but I'm not, I've been using it for more than 4 years daily and returning back to VBA just for quick testing or quick projects.
Hope this helps
From developing language, Excel Editor is VBA, and VS is C#/VB.NET. If you have a light function, you could use VBA directly, if you have a large requirement, .NET/VSTO would be suitable, it would be convenient to manage your code in VS, .NET.VSTO is managed code, it’s performance is better than VBA. With VSTO, you could custom Office UI. From distributing your project, you need to copy the office file with macro enabled. You could use ClickOnce or Windows installer to distribute .net/VSTO solution.

Trying to get excel 2003 into already made windows form

What my problem is is that I have a project that is in full design mode swing right now. I built it using the Windows form..
Anyways, on one of my forms..that I already started building (very painstakingly)..
Minds have changed and now what needs to be on that form is either a full excel 2003 workbook..or at the very least..excel worksheet.
The problem is that I have not been using studio 2008 for long..and coding experience shows the same.
Can someone please tell me how the heck I can put a worksheet or a workbook on that form without starting my whole project over using office forms?
Please..go slow with this newbie because i really don't know anything and Jargon is confusing me even more :(
I think you're looking for this:
http://www.codeproject.com/kb/office/Embedding_Excel.aspx

Pivot grid control for VB6. Does it exist?

I am looking for an OCX control that will work with VB6 and is capable of producing a grid like the one below.
Any ideas?
ComponentOne still makes a suite of ActiveX controls for VB6. Their VSFlexGridPro is very flexible (pun intended).
After surveying the 3rd party market, I could not find a single ActiveX control that could pivot data in a flexible manner. Ended up using DevExpress XtraPivotGrid for .NET via Interop.

How do I send an alert to a blackberry from an Excel 2007 spreadsheet?

I've been asked to find a way to send an alert to a blackberry when certain conditions are met on an Excel 2007 spreadsheet. The alert can be an SMS (preferred) or an email. The cell values are changing throughout the day from a DDE feed.
What are the typical solutions that people use to solve this?
I know next to nothing on the specifics of Excel or Office programming, but I can think of a few ways to solve the problem generically. I'm also assuming that the solution can be .Net based since Excel is available.
hook into the update process to test the conditions at the end of the update.
Office interop if you wanted a separate .net program instead that ran as a service or as a scheduled task.
Create an add-in for Excel. I have VS2008 Pro and I can create an Excel 2007 Add-in project.
Parse the Open Office XML for your conditions in a standalone program. This solution doesn't require .Net, just an XML parser,
When your conditions are met, you can use the following link to send your SMS or email.
What kind of technologies are available for sending text messages?
Another possibility would be to use AddEmail. Their blurb says: Email ActiveX (COM) Control - create and send HTML email messages with embedded images and attachments using SMTP/ESMTP protocol. Easily add email support to your Visual Basic 6 (VB6), ASP, ASP.NET, VB.NET, C++, C#, FoxPro, Access, PowerBuilder or Delphi application.
We use it a lot to automate our software registration system, and it'd be no problem to splice it into a bit of Excel VBA,
....
Dim oSmtpMail As New SmtpMail
Dim lRes As Long
lRes = oSmtpMail.SimpleSendScriptable(sRecipient, sRecipient, sSubj, sText, sError)
....
Okay, so it's email rather than SMS, but it's a start.

Any Metadata driven UI sample code?

I am in the process of designing a .net windows forms application that uses metadata to drive the UI. Apart from finding http://msdn.microsoft.com/en-us/library/ms954610.aspx, I have nothing much to look forward to. Anyone here worked on metadata driven User interfaces? What are the implications of following this methodology and any pointers would be greatly helpful.
The most obvious answer would be that Microsoft have themselves embraced this concept through their use of Xaml in Windows Presentation Foundation which replaces WinForms (to an extent).
If you want to stick to a WinForms, you may want to consider MyXaml which is kind of a homage to Xaml for WinForms!
You may want to check out Evolutility CRUD framework. It is an open source metadata driven framework for CRUD generating all UI at run-time.
It comes w/ source code (in C# and JS) and many samples.
http://www.evolutility.org
You may try this with HTA. Sometime back I created a metadata driven application using HTA and XML. I created XAML like structure and HTA-VBScript code to parse this structure and render diffent types of UI elements along with validations.
Check the Andromeda project out, which does so extensively. Too bad the stack isn´t .NET friendly (PHP, Postgres, Perl).

Resources