Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Can a variable be used when declaring an API call ?

Hi all

When declaring some API calls, is it possible to use a variable for the
"path" ? I have a standalone DLL that would be present in the directory the
worksheet / document is opened in that won't be registered on the system
locally... its functions can be accessed by pointing to the DLL - but I have
only even seen the path to the DLL hardcoded...

Private Declare Function FunctionName Lib "path" Alias "alias" (ByVal N As
Long) As Integer

TIA

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Can a variable be used when declaring an API call ?

Have you tested whether you actually need a path? I'm pretty sure that the
current path is checked. If so just the dll's name would suffice.

--
Jim
"Mike Iacovou" wrote in message
...
Hi all

When declaring some API calls, is it possible to use a variable for the
"path" ? I have a standalone DLL that would be present in the directory
the
worksheet / document is opened in that won't be registered on the system
locally... its functions can be accessed by pointing to the DLL - but I
have
only even seen the path to the DLL hardcoded...

Private Declare Function FunctionName Lib "path" Alias "alias" (ByVal N As
Long) As Integer

TIA

Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Can a variable be used when declaring an API call ?

thanks jim

using the declaration with the DLL in the same folder fails with a "not
found" error... I guess it expects either a registered library or an absolute
path...
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Can a variable be used when declaring an API call ?

First you need to confirm if this is an ActiveX DLL or a standard Windows
DLL.
The former:
- Needs registering
- You access it with by create an instance of its exposed classes

The latter:
- Does not need registering
- You call functions with the Declare statement similar to that you have
shown.

As for the error, it may be because one/some files that this DLL requires
are missing. Get a copy of Dependency Walker to check.

NickHK

"Mike Iacovou" wrote in message
...
thanks jim

using the declaration with the DLL in the same folder fails with a "not
found" error... I guess it expects either a registered library or an

absolute
path...



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
Declaring a tab name as a variable timmulla Excel Programming 2 January 25th 07 05:16 AM
Declaring a tab name as a variable timmulla Excel Programming 0 January 25th 07 03:26 AM
declaring public variable value Damon Excel Programming 4 July 24th 05 02:59 PM
Declaring Variable as VBConstant The Vision Thing Excel Programming 2 May 15th 04 06:35 PM
Declaring a variable? pgoodale[_4_] Excel Programming 2 January 2nd 04 03:26 PM


All times are GMT +1. The time now is 11:38 PM.

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

About Us

"It's about Microsoft Excel"