- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm trying to figure out how to debug DLLs (compiled with CVF 6.6.c), which are called from VBA programs (written in MS Excel or Access). I have followed the Visual Basic Debugging Considerations (http://h18009.www1.hp.com/fortran/docs/vf-html/pg/pgwvbdbg.htm), but I have so far been unable to step through the Fortran code using the Visual Studio debugger. Specifically, here's what I've done:
1) I compiled the DLL project following the appropriate guidelines above
2) In the Debug tab on the project setting menu, I specified the pathname for MS Access (e.g., C:Program FilesMicrosoft OfficeOFFICE11MSACCESS.EXE) or (...EXCEL.EXE) as the "Executable for debug session"
3) I then set a breakpoint in the DLL code
4) I stepped through the VBA code using the VBA debugger and the "Step Into (F8)" command until reaching the Call statement to the DLL.
5) I pressed F8 again expecting to be transferred to the VS debugger, but execution completes and control is returned to the VBA debugger without recognizing the breakpoint in the Fortran DLL code.
The bottom line is thatI am unable to trace program executionthrough the DLL. I've also tried to debug a very simple DLL (which simply calculates the sum of vector) called from a VBA program from Excel. This VBA/DLL combination works fine, but I am still unable to stepthrough the Fortran codeusing the visual studio debugger. Basically, I get the same results as above, i.e., execution doesn't stop at the breakpoint and simply returns to VBA window in Excel.
Any ideas on what I can do to correct this? Thanks for your time and patience.
-Paul Schwarz
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4) I stepped through the VBA code using the VBA debugger and the "Step Into (F8)" command until reaching the Call statement to the DLL.
5) I pressed F8 again expecting to be transferred to the VS debugger, but execution completes and control is returned to the VBA debugger without recognizing the breakpoint in the Fortran DLL code.
No you won't be transferred, as you're using different debuggers.
What you can do is to start the entire thing from CVF/VS debugger, and then you will be able to debug the dll, i.e. the breakpoint in Fortran will be hit.
However, you cannot debug VBA and CVF code simultaneously, i.e. seamlessly step from one to another. You have to debug VBA code with VBA debugger, and CVF code from VS debugger, but you can do it only in different sessions.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav and others,
Thanks for the information regarding debugging DLLs. So how do I actually start the debugging session from within CVF/VS that calls a VBA program running inside Excel or Access?
In my previous attempts at this, I've entered the fully-qualified path name for either Excel or Access as the "Executable for debug session" under the Project Settings/Debug tab. Then, when I start the CVF/VS debugger, I get the following Microsoft Developer Studio dialog box:
"C:Program FilesMicrosoft OfficeOFFICE11EXCEL.EXE does not contain debugging information. Press OK to continue."
If I press OK, a new copy of Excel is launched but the VBA program isn't executed. So, how does one set up the CVF/VS debugger to run the VBA program, which then calls the Fortran DLL?
Thanks.
-Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You specify excel.exe (or whatever) as the "executable to run" in the VF project. Then do whatever causes your DLL to be invoked.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page