+ Reply to Thread
Results 1 to 3 of 3

Problem with Excel 2003 and VBA to Open Doc

  1. #1
    bema
    Guest

    Problem with Excel 2003 and VBA to Open Doc

    We are trying to call System-DLL Functions zu get Temp-Folder-Path and
    REgistry Settings.

    We try to read RegOpenKeyA and RegQueryValue EXA and RegCloseKey out of
    ADVAPI32.dll and try to read GetTempPathA aus Kernell32.dll.

    This is working fine on some Pcs. But we have also trouble on others ! ??
    The Registry Call delivers no failure and no value. GetTempPathA close with
    failure Value 0

    On the PCs with problems where is also another apllication using the
    GetTempPathA Call with no problems.

    How can we solve this ??


    ----------------
    This post is a suggestion for Microsoft, and Microsoft responds to the
    suggestions with the most votes. To vote for this suggestion, click the "I
    Agree" button in the message pane. If you do not see the button, follow this
    link to open the suggestion in the Microsoft Web-based Newsreader and then
    click "I Agree" in the message pane.

    http://www.microsoft.com/communities...el.programming

  2. #2
    Tom Ogilvy
    Guest

    Re: Problem with Excel 2003 and VBA to Open Doc

    How about just using the Environ Variable:

    ? environ("Temp")
    C:\DOCUME~1\OgilvyTW\LOCALS~1\Temp


    --
    Regards,
    Tom Ogilvy


    "bema" <bema@discussions.microsoft.com> wrote in message
    news:0E7379C7-64C6-4BB6-AA96-F531F208ACAE@microsoft.com...
    > We are trying to call System-DLL Functions zu get Temp-Folder-Path and
    > REgistry Settings.
    >
    > We try to read RegOpenKeyA and RegQueryValue EXA and RegCloseKey out of
    > ADVAPI32.dll and try to read GetTempPathA aus Kernell32.dll.
    >
    > This is working fine on some Pcs. But we have also trouble on others ! ??
    > The Registry Call delivers no failure and no value. GetTempPathA close

    with
    > failure Value 0
    >
    > On the PCs with problems where is also another apllication using the
    > GetTempPathA Call with no problems.
    >
    > How can we solve this ??
    >
    >
    > ----------------
    > This post is a suggestion for Microsoft, and Microsoft responds to the
    > suggestions with the most votes. To vote for this suggestion, click the "I
    > Agree" button in the message pane. If you do not see the button, follow

    this
    > link to open the suggestion in the Microsoft Web-based Newsreader and then
    > click "I Agree" in the message pane.
    >
    >

    http://www.microsoft.com/communities...el.programming



  3. #3
    bema
    Guest

    Re: Problem with Excel 2003 and VBA to Open Doc

    Thank you for your answer.

    But this is not the solution for our problem. I know that I can take
    "environ" instead of the kernel32.dll-function "GetTempPathA" to obtain the
    TEMP-Path (or in Word but not in Excel "system.PrivateProfileString" for
    registry-settings).

    The strange behavior appears only on some workstations. On these computers I
    am not able to call DLL-functions out of Word/Excel-VBA. Simple call's like
    "GetTempPathA"
    (kernel32.dll)
    or "RegOpenKeyA", "RegQueryValueExA" or "RegCloseKey" (ADVAPI32.DLL) fails.

    For example:
    "GetTempPathA" returns 0 as result-values which means "error", but what error?
    "RegQueryValueExA" returns no error but an empty string instead the real value

    Are there any security-settings to prohibit external calls?

    In other programming languages (like C++ or Delphi) we have no problem to
    call these DLL-functions on the affected computers.

    Please don't forget: For me it is important to call standard-DLL-functions!
    These Word/Excel-macros works for 3 years without any problems; since Office
    2003/XP SP2 there is this strange behavior on some (3 of about 25)
    workstations.

    "Tom Ogilvy" wrote:

    > How about just using the Environ Variable:
    >
    > ? environ("Temp")
    > C:\DOCUME~1\OgilvyTW\LOCALS~1\Temp
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "bema" <bema@discussions.microsoft.com> wrote in message
    > news:0E7379C7-64C6-4BB6-AA96-F531F208ACAE@microsoft.com...
    > > We are trying to call System-DLL Functions zu get Temp-Folder-Path and
    > > REgistry Settings.
    > >
    > > We try to read RegOpenKeyA and RegQueryValue EXA and RegCloseKey out of
    > > ADVAPI32.dll and try to read GetTempPathA aus Kernell32.dll.
    > >
    > > This is working fine on some Pcs. But we have also trouble on others ! ??
    > > The Registry Call delivers no failure and no value. GetTempPathA close

    > with
    > > failure Value 0
    > >
    > > On the PCs with problems where is also another apllication using the
    > > GetTempPathA Call with no problems.
    > >
    > > How can we solve this ??
    > >
    > >
    > > ----------------
    > > This post is a suggestion for Microsoft, and Microsoft responds to the
    > > suggestions with the most votes. To vote for this suggestion, click the "I
    > > Agree" button in the message pane. If you do not see the button, follow

    > this
    > > link to open the suggestion in the Microsoft Web-based Newsreader and then
    > > click "I Agree" in the message pane.
    > >
    > >

    > http://www.microsoft.com/communities...el.programming
    >
    >
    >


+ 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