Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ATPVBAEN.xla!Moveavg- where to find explanation of arg involved.

For ATP and similar add-in, I always confused where I can get details how to
use their inbuilt functions. Also, any library souce for me to know what
function i can pick out to use form which "possible add-in" (including xla,
dll etc.)
thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default ATPVBAEN.xla!Moveavg- where to find explanation of arg involved.

You can use any DLL in a VBA macro by defining the call to the library
function, Here is an example

' Declare wininet.dll API Functions
Public Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias
"FtpSetCurrentDirectoryA" _
(ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean

Public Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias
"FtpGetCurrentDirectoryA" _
(ByVal hFtpSession As Long, ByVal lpszCurrentDirectory As String,
lpdwCurrentDirectory As Long) As Boolean

Public Declare Function InternetWriteFile Lib "wininet.dll" _
(ByVal hFile As Long, ByRef sBuffer As Byte, ByVal lNumBytesToWite As Long, _
dwNumberOfBytesWritten As Long) As Integer

Public Declare Function FtpOpenFile Lib "wininet.dll" Alias "FtpOpenFileA" _
(ByVal hFtpSession As Long, ByVal sBuff As String, ByVal Access As Long,
ByVal Flags As Long, ByVal Context As Long) As Long

Public Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" _
(ByVal hFtpSession As Long, ByVal lpszLocalFile As String, _
ByVal lpszRemoteFile As String, _
ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean



Usually I go to microsfot.com and find the paraemeter list and entry points
for the library function. There is some manpulating of the parameter
definitions that you have to do. For example parameters which are pointers
are defined in VBA as Long. Then you have to define a TYPE (in place of a
structure in C language) in VBA like this

Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As Currency
ftLastAccessTime As Currency
ftLastWriteTime As Currency
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type

This type is used below

Public Declare Function FtpFindFirstFile Lib "wininet.dll" Alias
"FtpFindFirstFileA" _
(ByVal hInternetSession As Long, ByVal lpszSearchFile As String, _
ByRef lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Long



"Vivadad" wrote:

For ATP and similar add-in, I always confused where I can get details how to
use their inbuilt functions. Also, any library souce for me to know what
function i can pick out to use form which "possible add-in" (including xla,
dll etc.)
thanks,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default ATPVBAEN.xla!Moveavg- where to find explanation of arg involved.

In the VBE window press F2 to bring up the object browser - left click
ATPVBAEN.xla in the project window and choose atpvbaen.xls in the object
browser - all functions are listed there.

"Vivadad" wrote:

For ATP and similar add-in, I always confused where I can get details how to
use their inbuilt functions. Also, any library souce for me to know what
function i can pick out to use form which "possible add-in" (including xla,
dll etc.)
thanks,

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default ATPVBAEN.xla!Moveavg- where to find explanation of arg involved.

Hi Joel,

The OP is asking how to use functions in the ATPVBAEN.xla. This addin is a
glorified wrapper to call functions in ANALYS32.XLL. Normally for VBA to
call functions in an XLL means using Application.Run (after Registering the
functions). In theory, even though documented otherwise, it should be
possible to call functions directly from an XLL without app.run. However I
have not managed to do that from the ATP xll, possibly due to
incomplete/incorrect use of LPXLOPER __stdcall. Do you know how to write the
declarations?

Regards,
Peter T

"Joel" wrote in message
...
You can use any DLL in a VBA macro by defining the call to the library
function, Here is an example

' Declare wininet.dll API Functions
Public Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias
"FtpSetCurrentDirectoryA" _
(ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean

Public Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias
"FtpGetCurrentDirectoryA" _
(ByVal hFtpSession As Long, ByVal lpszCurrentDirectory As String,
lpdwCurrentDirectory As Long) As Boolean

Public Declare Function InternetWriteFile Lib "wininet.dll" _
(ByVal hFile As Long, ByRef sBuffer As Byte, ByVal lNumBytesToWite As
Long, _
dwNumberOfBytesWritten As Long) As Integer

Public Declare Function FtpOpenFile Lib "wininet.dll" Alias "FtpOpenFileA"
_
(ByVal hFtpSession As Long, ByVal sBuff As String, ByVal Access As Long,
ByVal Flags As Long, ByVal Context As Long) As Long

Public Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" _
(ByVal hFtpSession As Long, ByVal lpszLocalFile As String, _
ByVal lpszRemoteFile As String, _
ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean



Usually I go to microsfot.com and find the paraemeter list and entry
points
for the library function. There is some manpulating of the parameter
definitions that you have to do. For example parameters which are
pointers
are defined in VBA as Long. Then you have to define a TYPE (in place of a
structure in C language) in VBA like this

Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As Currency
ftLastAccessTime As Currency
ftLastWriteTime As Currency
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type

This type is used below

Public Declare Function FtpFindFirstFile Lib "wininet.dll" Alias
"FtpFindFirstFileA" _
(ByVal hInternetSession As Long, ByVal lpszSearchFile As String, _
ByRef lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Long



"Vivadad" wrote:

For ATP and similar add-in, I always confused where I can get details how
to
use their inbuilt functions. Also, any library souce for me to know what
function i can pick out to use form which "possible add-in" (including
xla,
dll etc.)
thanks,



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default ATPVBAEN.xla!Moveavg- where to find explanation of arg involved.

Just to add, either set a reference to the addin in your project
(tools/references) or do as Sam suggests, find your functions in Object
browser then use the Application.Run method

Regards,
Peter T

"Sam Wilson" wrote in message
...
In the VBE window press F2 to bring up the object browser - left click
ATPVBAEN.xla in the project window and choose atpvbaen.xls in the object
browser - all functions are listed there.

"Vivadad" wrote:

For ATP and similar add-in, I always confused where I can get details how
to
use their inbuilt functions. Also, any library souce for me to know what
function i can pick out to use form which "possible add-in" (including
xla,
dll etc.)
thanks,





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ATPVBAEN.xla!Moveavg- where to find explanation of arg involved.

Thanks to all you helping.
My key question where I can know the exact requirement in the parameters of
a function call out from an add-in.
Next: Moveavg, what is the differnece from MoveavgQ.
Still question on Moveavg, I use MA(20) on a data column L2:L33, destination
at W2. I wish to get stdevp at teh same time, I tick standand error box, but
got wrong message which I could not understand nor get any library info
explaining what being required.
vba line

Applicaiton.Run
"ATPVBAEN.xla!Moveravg",Activesheet.Range("L2:L33" ).Activesheet.range($W$2"),20, true,false, false
error message

" moving Average- Estimated output table will extend beyond the bounds of
the worksheet. Please choose different reference".......how to resolve?
Next, on a broader level, where I can find the official quide on using
functions of a library?.....any such publishes from microsoft

To Joel, on the DLL, your mentioned "parameter list on micirosoft.com, I
need time to attempt.



"Vivadad" wrote:

For ATP and similar add-in, I always confused where I can get details how to
use their inbuilt functions. Also, any library souce for me to know what
function i can pick out to use form which "possible add-in" (including xla,
dll etc.)
thanks,

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
Percentage with a zero involved tankerman Excel Discussion (Misc queries) 8 March 5th 09 09:08 AM
How to find explanation of Excel error values in Help? [email protected] Excel Discussion (Misc queries) 4 November 29th 07 08:08 AM
Where to find formula & explanation on Compound Interest etc Centrol Excel Discussion (Misc queries) 1 September 26th 07 07:40 AM
Atpvbaen.xls FilippoRotolo Excel Worksheet Functions 0 July 14th 06 05:47 PM
atpvbaen.xls mike allen[_2_] Excel Programming 4 December 24th 04 09:10 PM


All times are GMT +1. The time now is 06:40 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"