Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Help DLL calling in Excel 2007 crashes
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Wheeley, post: 6310070"] This is going to sound weird and I have look for some help all over the net to no avail. I have an add-in which contains numerous VBA functions in it. One of these functions calls a function in a DLL and when that DLL function returns, the VBA continues executing by starting the same VBA function over. First off, this call works perfectly in Excel 2002 & 2003. But in Excel 2007, the DLL call causes the VBA function to restart to the top. Here is the declaration of the DLL call: Private Function EnablePrinter Lib "cdintf.dll" (ByVal hPrinter As Long, ByRef szCompany As String, ByRef szCode As String) As Long The VBA funtion is something like this: Public Function ConvertPlain(ByVal XLSFilename, ByVal PrintToPrinterName As String, ByVal Printer As Long, ByVal LicensedTo As String, ByVal ActivationCode As String) As Integer ConvertPlain = 1 Application.Workbooks.Open XLSFileName, 3, False ActiveWorkbook.RunAutoMacros xlAutoOpen With ActiveWorkBook EnablePrinter(Printer, LicensedTo, ActivationCode) .PrintOut ActivePrinter:=PrintToPrinterName End With End Function So when the EnablePrinter function executes, the next line executing is ConvertPlain = 1. Go figure. Any help welcome Wheeley [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Help DLL calling in Excel 2007 crashes
Top