Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Access current active workbook from DLL

Dear all,
I will write a DLL by using Visual Basic. Then I will call
the DLL in Excel VBA. Some variables will be passed to the DLL from
VBA. After that, the DLL will get recordset from database will fill the

cells in current active workbook. My question is how can I access the
current active workbook from the DLL? As I know, there is Microsoft
Excel 8.0 Object Library for VB? If this library is used to access
the current active workbook,what is the code to access current active
workbook and sheet?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Access current active workbook from DLL

There are various objects you can work with :
ActiveWorkbook
ActiveSheet
ActiveCell

Depending how the DLL and Excel interact ;
- Excel passes criteria & Recordset object to DLL DLL queries DB and
receives data DLL passes back filled RS Excel fills range
The DLL does need to know anything about Excel; Excel and DLL need ADO.
- Excel passes criteria & start Range to DLL DLL queries DB and receives
data DLL fills data starting at passed range
DLL needs to know about Excel & ADO.

NickHK

"hon123456" wrote in message
ups.com...
Dear all,
I will write a DLL by using Visual Basic. Then I will call
the DLL in Excel VBA. Some variables will be passed to the DLL from
VBA. After that, the DLL will get recordset from database will fill the

cells in current active workbook. My question is how can I access the
current active workbook from the DLL? As I know, there is Microsoft
Excel 8.0 Object Library for VB? If this library is used to access
the current active workbook,what is the code to access current active
workbook and sheet?

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate current active cell - Help Please!! Larry Excel Worksheet Functions 0 July 19th 06 10:19 PM
Inesert value of column B of the current row into active cell PPL[_2_] Excel Programming 4 March 5th 06 08:13 PM
How to indicate that the current visible worksheet is the active o George Furnell[_2_] Excel Programming 1 February 17th 06 05:28 PM
Identify current active cell reades Excel Worksheet Functions 6 January 10th 06 12:48 PM
How to detect current active sheet number Mike Chen Excel Programming 3 April 3rd 04 04:41 PM


All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"