Solved

Writing COM Add In for Excel with VB6

Posted on 2011-02-27
3
367 Views
Last Modified: 2012-05-11
Thanks to rorya I have worked through Chip Pearson's tutorial on creating COM AddIn with VB6. It's a good example of Automation Add In.

I'd need to go a little further. I read somewhere that you can create VBA code for Excel from VB6 itself. That is, so I can debug and (hopefully) have Intellisense also. Is this possible? If so can someone direct me to a learning source please?

Info: So far, I have copied and pasted VBA code from the VBE to the Class in VB6. I can make simple things like 'show a message box' work. For data access with ADO etc. (which I can do in Excel VBA) I need to be able to write my code in VB6 just like I do in VBA, test etc. (This is so that I can make a COM AddIn to work with Excel 2010)

Thanks!
0
Comment
Question by:hindersaliva
  • 2
3 Comments
 
LVL 5

Expert Comment

by:wellous
ID: 34992623
Hi hindersaliva,
Please read Integrating with COM Applications for detailed information about how to call WCF service from VB6/VBScript client application.
http://msdn.microsoft.com/en-us/library/ms733928.aspx
Windows Communication Foundation (WCF) services can be integrated directly into your existing code by using the WCF service moniker. The service moniker can be used from a wide range of COM-based development environments, such as Office VBA, Visual Basic 6.0, or Visual C++ 6.0.

You need to check whether the Initialize requires the parameter in this scenario. About configuration file, you need to place the binding definitions (generated by the ServiceModel Metadata Utility Tool (Svcutil.exe) in the generated client application configuration file) in the client application's configuration file. For example, for a Visual Basic 6.0 executable named CallCenterClient.exe, the configuration should be placed in a file named CallCenterConfig.exe.config within the same directory as the executable. The client application can now use the moniker.

If you have any further issues, feel free to tell us.
Brgds
Wellous
0
 
LVL 5

Accepted Solution

by:
wellous earned 500 total points
ID: 34992658
Hi,
It's me again, also pls check these sites if you need something simple tasks.
Good luck

http://theopensourcery.com/vb12tut.htm
http://www.programmersheaven.com/mb/vba/359929/359929/applying-vb6-to-excel/
-------------------------------------------------------------------------------------------------
Also read here about how To Use ADOX with Excel Data from Visual Basic or VBA
http://support.microsoft.com/kb/303814/EN-US

Tks, Wellous
0
 

Author Closing Comment

by:hindersaliva
ID: 34992807
Simple as it was this one gave me the missing link. Perfect!

http://www.programmersheaven.com/mb/vba/359929/359929/applying-vb6-to-excel/

You guys are fantastic.
Thanks Wellous.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now