Problem:
You are using Swiss Ephemeris swedll32.dll in your VB6 project. The compiled EXE works perfectly, but during debugging in the VB6 IDE, you get "file not found: swedll32.dll" errors.
Why This Happens:
The VB6 debugger and compiled EXE have different DLL search paths:
Compiled EXE: Looks in the same folder as the executable
VB6 Debugger: Looks in VB6 IDE folder, system folders, but NOT your project folder
Solutions That Worked:
Copy to VB6 IDE Folder
cmd
copy swedll32.dll "C:\Program Files\Microsoft Visual Studio\VB98\"
This ensures the debugger finds the DLL where it searches.
Copy to System32 (Already tried but good for reference)
cmd
copy swedll32.dll C:\Windows\System32\
Run VB6 as Administrator
Right-click VB6 shortcut → "Run as Administrator"
Ensures proper file access permissions
Use Absolute Path in Declare Statements
vb
' Instead of: Declare Function swe_calc Lib "swedll32.dll" (...) ' Use: Declare Function swe_calc Lib "C:\Windows\System32\swedll32.dll" (...)
Key Insight:
swedll32.dll is a regular DLL (not COM), so it cannot be added to VB6 project references. The debugger needs to find it in its search path.