Solved

Writing COM Add In for Excel with VB6

Posted on 2011-02-27
3
368 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA macro broke in Excel 2016 in windows 10 5 62
location range 4 22
adding to,subject,body for the opened mail instead of creating new mail 15 31
Excel partial font macro 14 26
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

914 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

12 Experts available now in Live!

Get 1:1 Help Now