Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
A decade ago, I last ran dlls from the VBA environment. I'm tryin again, and my day of reading, hacking and googling has yeilded only failure for me. When I use Application.Run, it appears that the executable dll is being read as a text file input to the spreadsheets. Here is a test case code, in the .xls file, VBA environment, in the ThisWorkbook module: Option Explicit 'be sure to go to Tools--References and add in the reference to the desired dll/exe/ocx Private Declare Sub Main Lib "C:\Documents and Settings\TestCase \Project1.dll" () Sub TestCase() Application.Run ("C:\Documents and Settings\TestCase\Project1.dll! Main") End Sub I have a Project1.vbp, with a single class module in it, Class1. It is compiled to Project1.dll. The code of Class1 is: Public Sub Main() MsgBox "Main" End Sub When I run TestCase, I get a message box indicating the following lines: This file is not in a recognizable format. If you know the file is from another program which is incompatible with Microsoft Office Excel, click Cancel, ....... If you suspect the file is damaged, click Help for more information about solving the problem. If you still want to see what text is contained in the file, click OK..... If I hit OK, the binary of the dll is read in to a spreadsheet. What am I screwing up? Other info: Excel VBA environment About Microsoft Visual Basic Microsoft Visual Basic 6.3 Version 9972 VBA: Retail 6.4.9972 VB6 environment Microsoft Visual Basic 6.0 For 32-bit Windows Development Version 8176 VBA: Retail 6.0.8169 I'm on an XP system. thanks, Matt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Problem viewing Excel 2003 Pivot Chart fields in Excel 2007 | Charts and Charting in Excel | |||
Weird problem with Excel 2000...Worksheets disappearing in a shared Excel file | Excel Discussion (Misc queries) | |||
Weird problem with Excel 2000...Worksheets disappearing in a shared Excel file | Excel Programming | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) |