Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 20th, 2004, 07:47 AM
Authorized User
Join Date: Jan 2004
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Referencing a spreadsheet from an ActiveX DLL


I am writing an ActiveX DLL with VB6, which is referenced by my Excel spreadsheet. i.e. my DLL has functions which I call from the VBA in the spreadsheet.

I am passing cell data from the spreadsheet as parameters when I call the DLL functions from the VBA. The DLL then manipulates that data and sends back the results to the spreadsheet VBA. The VBA then plugs the results into the appropriate cells.

This is the first time I have done this, and have a related question.

Instead of passing the cell data to the DLL functions, is there a way that a DLL function can "look at" the spreadsheet and get the cell data for itself? This would involve (I guess) the DLL function being able to reference the spreadsheet (workbook) in some way.

Is this possible? If so, how do I do it?

Hope you can help - all info is useful as I am new to this.

Many thanks.



Reply With Quote
  #2 (permalink)  
Old January 20th, 2004, 06:20 PM
Friend of Wrox
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post

check out http://www.greggriffiths.org/webdev/both/excel/ which covers VBScript ASP -> Excel connections and may provide some useful info and links for you.
Reply With Quote
  #3 (permalink)  
Old January 23rd, 2004, 07:21 AM
Authorized User
Join Date: Jul 2003
Location: Reading, Berkshire, United Kingdom.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alex_read

You could potentially use the findwindow / findwindowex api calls to lookup an open excel instance but the way you're doing this is the best way by far & much less prone to errors occurring.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble referencing a DLL in VS2005 sgurkin Visual Studio 2005 0 November 5th, 2008 12:53 PM
Advantages /Disadvantages of ActiveX DLL & ActiveX priyank Beginning VB 6 6 February 19th, 2007 11:34 AM
Can an ActiveX DLL reference a spreadsheet? james gold Excel VBA 0 October 2nd, 2003 10:03 AM
Can a VB6 ActiveX DLL reference a spreadsheet? james gold Pro VB 6 0 October 2nd, 2003 10:02 AM
Referencing an ActiveX DLL from Excel james gold Excel VBA 1 September 10th, 2003 10:41 AM

All times are GMT -4. The time now is 03:44 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.