Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old May 3rd 04, 02:21 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: May 2004
Posts: 1
Default VB won't recognize function in Analysis Tool Pak

I am running Microsoft Office 2000 professional edition. I wrote a VB macro for an excel spreadsheet. I need to use some functions like LCM (least common multiple) and GCD (greatest common divisor). I have an old Function Reference Manual which states that these functions may be accessible only by loading the Analysis Tool Pak. I did that and loaded the Analysis ToolPak, Analysis ToolPak - VBA, and Update Add-in Links. (Tools menu, then Add-Ins). The system asked for the CD rom which I insereted - so it looked like it did add it in. Unfortunately when I try to execute the macro I keep getting the message Run-time error '438'. Object doesn't support this property or method. When I click on the debug option the system points to the exact statement with the LCM function. Am I missing something? Any ideas



  #2   Report Post  
Old May 3rd 04, 02:37 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 27,285
Default VB won't recognize function in Analysis Tool Pak

in the VBE you should see in the project explorer

atpvbaen.xls(ATPVBAEN.XLA)
funcres(FUNCRES.XLA)

The first shows Analysis toolpak - vba is loaded
The second show Analysis toolpak is loaded

If you don't see them go to Excel and in tools=Addins, select Analysis
toolpak and Analysis toolpak - vba

Now you can call those function using application.Run (as an example from
the immediate window)

? application.Run("ATPVBAEN.XLA!lcm",24,36)
72


vVal = application.Run("ATPVBAEN.XLA!lcm",24,36)

to reference a range

vVal = application.Run("ATPVBAEN.XLA!lcm",Range("A11"),Ra nge("A12"))

as an example.

--
Regards,
Tom Ogilvy


"Barry Wolfson" wrote in message
...
I am running Microsoft Office 2000 professional edition. I wrote a VB

macro for an excel spreadsheet. I need to use some functions like LCM (least
common multiple) and GCD (greatest common divisor). I have an old Function
Reference Manual which states that these functions may be accessible only by
loading the Analysis Tool Pak. I did that and loaded the Analysis ToolPak,
Analysis ToolPak - VBA, and Update Add-in Links. (Tools menu, then Add-Ins).
The system asked for the CD rom which I insereted - so it looked like it did
add it in. Unfortunately when I try to execute the macro I keep getting the
message Run-time error '438'. Object doesn't support this property or
method. When I click on the debug option the system points to the exact
statement with the LCM function. Am I missing something? Any ideas?






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
Data Analysis Tool Cesar Excel Worksheet Functions 5 February 24th 09 05:44 AM
Problem with Regression function in 2007, Analysis Tool Pak Lauren273 Excel Discussion (Misc queries) 2 May 25th 08 10:00 PM
analysis tool Alex Excel Discussion (Misc queries) 5 May 10th 06 10:26 PM
How can I add data analysis function in tool? Michiko Excel Worksheet Functions 1 November 8th 05 10:26 AM
After adding Analysis Tool Pack, still no PRICE function, why? mtburdett Excel Worksheet Functions 1 November 5th 05 10:43 AM


All times are GMT +1. The time now is 10:28 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017