- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From Excel vba, I call a vf dll which opens and reads part of a file, then returns to the vba. Normally, another call to the vf dll occurs and more is read from the file.
But in some circumstances, I want to quit and return to the initial situation. So I execute
END
in the vba which finishes the vba and unloads the dll.
But the file is now inaccessible.
Any way around this? other than closing the file before each return...
But in some circumstances, I want to quit and return to the initial situation. So I execute
END
in the vba which finishes the vba and unloads the dll.
But the file is now inaccessible.
Any way around this? other than closing the file before each return...
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I canonly guess as to what you mean by "file is now inaccessible". But I have an idea what it means.
It sounds like you are NOT using a com server. If you did upon unloading the DLL the destructor for the com-server is called whereupon you can close the file.
If you do not want to do that, implemnent the clean up manually in your DLL and call it just before you call the END in VBA.
Tim
It sounds like you are NOT using a com server. If you did upon unloading the DLL the destructor for the com-server is called whereupon you can close the file.
If you do not want to do that, implemnent the clean up manually in your DLL and call it just before you call the END in VBA.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You certainly need to close the file before it can be re-opened. From your last comment, I take it that you're not even attempting to close it. Evidently, vba has no way of automatically closing files opened by Fortran.
On XP, with certain applications installed, such as United Devices, the OS may ignore one or more of the API calls involved in closing a file, so the "in-use" lock remains set until reboot. Similar things will happen on any Windows if a file is shared,opened from elsewhere on the network, and the network connection dies.
On XP, with certain applications installed, such as United Devices, the OS may ignore one or more of the API calls involved in closing a file, so the "in-use" lock remains set until reboot. Similar things will happen on any Windows if a file is shared,opened from elsewhere on the network, and the network connection dies.

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