Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 attachments open and show only empty cells when openedvia Outlook 2003? Rob Gordon Excel Discussion (Misc queries) 1 December 2nd 08 09:34 PM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
email from excel 2003 is not sent unless outlook 2003 is open jack of alltrades Excel Discussion (Misc queries) 0 June 21st 06 05:56 PM
still having problem with open currently open excel file John Coon Excel Programming 2 September 4th 04 04:34 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM


All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"