+ Reply to Thread
Results 1 to 2 of 2

Unable to call external program/dll

  1. #1
    Registered User
    Join Date
    05-26-2005
    Posts
    2

    Unhappy Unable to call external program/dll

    Hoi,

    I would like to call up another application from within Excel/VBA. The simple use of 'Shell "prog"' does not work on one computer (WinXP/Office Excel 2003(11)/VB6.3), but perfectly well on another (Win2000/Excel2000(9)/VB6.0). The return value is always 0 on the WinXp machine; no process is ever started there while I certainly have permission to run that application from the command line.

    This lead me to try ShellExecute by using a Declare statement. Same problem: Always a 0 as return value. ShellExecute API claims a zero means Out of memory. But.. It turns out I cannot call any external Dll. Return value is always zero.

    Butchering the Declare statement to include a bogus dll or function name gives the same result. A silent zero return value. Never an error 53 (file not found) or 453 (function not found) as the Win2000 machine pops up in such cases. It is as if external calls are disabled.. (can it be disabled? is this a "security" fix in xp or office? how to turn it off?)

    Does anyone recognice these sympthoms? What would be the cause and how can I fix it? Searching Google and a few VB forums didn't help me at all. Everyone seems to use Declare and calling Dll functions for this and that without ever mentioning any problems. I'm the only one?

  2. #2
    Registered User
    Join Date
    05-26-2005
    Posts
    2

    The Anti-Virus Scanner blocked my Excel/VBA macro script

    Bah, bah!

    After having searched all settings in Windows, Office, Excel, and Visual Basic (and all of them at least three times each) I finally had the bright idea to check what the firewall and anti-virus programs are capable of at the "faulty" computer.

    It was the virus scanner that blocked my excel macro.

    So, just for the records (in case someone else would search for help on this problem in the future):

    I wanted to start another application from within an excel/vba macro. The "Shell" command did not work. Using "ShellExecute" from shell32.dll did not work. Actually it was not possible to call any external finction in any dll. All this worked perfectly well on an older computer (with older software) but not on a newer computer (with newer software).

    Recent versions of Kaspersky's anti-virus scanner (and most likely other virus scanners as well?) uses real-time vba macros monitoring. It can block a command or abort a macro that tries to use shell commands, windows api calls, delete files and directories, and so on, and so on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1