Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello everyone. I am trying to create a custom dll to show a message box. I
am running into difficulty when I try to call the custom dll function custom menuitem. Excel gives the messagebox that it caused a serious error and needs to close. I have a partial work around in the custommenu xla in thisworkbook object i use sendkeys to open and exit the vb editor and tis works great. but if I open an excel file it seems to halt opening the file after I open and close the vb editor window. Any insites about this would be greatly appreciated. Thanks in advance In the general declaration section I have the following: Private Declare Sub message Lib "g:\paul\stringsPart2\string2dll.dll" () I call this sub from a sub in a module The sub is as follows: Private Sub CHKNet() message End Sub The sub in the custom dll is as follows: Private Sub message() MsgBox "Can you read this" End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can't create Windows DLLs in VB or VBA. You can only create
ActiveX DLLs. Your ActiveX DLL should have a creatable class that exposes the properties and methods. Then, you don't use the Declare statement, but instead use code like Dim MyClass As MyDLLProject.CreatableClass Set MyClass = New MyDLLProject.CreatableClass MyClass.MyProcedure -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Paul" wrote in message ... Hello everyone. I am trying to create a custom dll to show a message box. I am running into difficulty when I try to call the custom dll function custom menuitem. Excel gives the messagebox that it caused a serious error and needs to close. I have a partial work around in the custommenu xla in thisworkbook object i use sendkeys to open and exit the vb editor and tis works great. but if I open an excel file it seems to halt opening the file after I open and close the vb editor window. Any insites about this would be greatly appreciated. Thanks in advance In the general declaration section I have the following: Private Declare Sub message Lib "g:\paul\stringsPart2\string2dll.dll" () I call this sub from a sub in a module The sub is as follows: Private Sub CHKNet() message End Sub The sub in the custom dll is as follows: Private Sub message() MsgBox "Can you read this" End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Chip Pearson" wrote:
"You can't create Windows DLLs in VB or VBA. You can only create ActiveX DLLs. " Can you create ActiveX DLLs in VBA? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "AA2e72E" wrote in message ... "Chip Pearson" wrote: "You can't create Windows DLLs in VB or VBA. You can only create ActiveX DLLs. " Can you create ActiveX DLLs in VBA? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I didn't think you could; however, your turn of phrase implied you could ...
at least my reading of it. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
why not? I think I did.
"Chip Pearson" wrote: No. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "AA2e72E" wrote in message ... "Chip Pearson" wrote: "You can't create Windows DLLs in VB or VBA. You can only create ActiveX DLLs. " Can you create ActiveX DLLs in VBA? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul,
Unless you followed the steps on http://www.windowsdevcenter.com/pub/...reate_dll.html what you have is an ActiveX dll. NickHK "Paul" wrote in message ... why not? I think I did. "Chip Pearson" wrote: No. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "AA2e72E" wrote in message ... "Chip Pearson" wrote: "You can't create Windows DLLs in VB or VBA. You can only create ActiveX DLLs. " Can you create ActiveX DLLs in VBA? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hyperlink troubles | Excel Discussion (Misc queries) | |||
Troubles | Excel Discussion (Misc queries) | |||
Formula troubles | Excel Discussion (Misc queries) | |||
COM Add-in Troubles | Excel Discussion (Misc queries) | |||
IF troubles | Excel Worksheet Functions |