PC Review


Reply
Thread Tools Rate Thread

Call user defined function in an add-in

 
 
=?Utf-8?B?RGFsZSBGeWU=?=
Guest
Posts: n/a
 
      15th Dec 2006
In addition to the previous post, I would like to be able to call a function
that resides in an add-in from a cell in a spreadsheet.

When I type: =FormatChart(yada, yada, yada....)
into a cell, the function seems to lock up. One of the things about this
function is that is it selects a specific worksheet, and then actually
selects cells in that worksheet. Might this be causing some of my problems?
Should I modify the code so that it only points to the sheet and cells rather
than actually selecting them?

Dale
--
Email address is not valid.
Please reply to newsgroup only.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      15th Dec 2006
UDF's used in a worksheet cell can't do things like selecting sheets. They
can't return a value to another cell, either. (Just a warning <bg>.)



Dale Fye wrote:
>
> In addition to the previous post, I would like to be able to call a function
> that resides in an add-in from a cell in a spreadsheet.
>
> When I type: =FormatChart(yada, yada, yada....)
> into a cell, the function seems to lock up. One of the things about this
> function is that is it selects a specific worksheet, and then actually
> selects cells in that worksheet. Might this be causing some of my problems?
> Should I modify the code so that it only points to the sheet and cells rather
> than actually selecting them?
>
> Dale
> --
> Email address is not valid.
> Please reply to newsgroup only.


--

Dave Peterson
 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      15th Dec 2006

> rather than actually selecting them.


Getting out of the Select habit is a very good move. It is almost NEVER
necessary to select anything in VBA. ActiveWindow.FreezePanes = True is the
only time that I can think of that you need to Select anything.

Not using Select will make your code faster and much more maintainable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Dale Fye" <(E-Mail Removed)> wrote in message
newsB84B5FB-86E3-4217-B102-(E-Mail Removed)...
> Thanks, Dave. I guess I'll have to rewrite the function so that it
> references the worksheets and cells, rather than actually selecting them.
>
> Dale
> --
> Email address is not valid.
> Please reply to newsgroup only.
>
>
> "Dave Peterson" wrote:
>
>> UDF's used in a worksheet cell can't do things like selecting sheets.
>> They
>> can't return a value to another cell, either. (Just a warning <bg>.)
>>
>>
>>
>> Dale Fye wrote:
>> >
>> > In addition to the previous post, I would like to be able to call a
>> > function
>> > that resides in an add-in from a cell in a spreadsheet.
>> >
>> > When I type: =FormatChart(yada, yada, yada....)
>> > into a cell, the function seems to lock up. One of the things about
>> > this
>> > function is that is it selects a specific worksheet, and then actually
>> > selects cells in that worksheet. Might this be causing some of my
>> > problems?
>> > Should I modify the code so that it only points to the sheet and cells
>> > rather
>> > than actually selecting them?
>> >
>> > Dale
>> > --
>> > Email address is not valid.
>> > Please reply to newsgroup only.

>>
>> --
>>
>> Dave Peterson
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call to INDIRECT within user defined function Philip Mark Hunt Microsoft Excel Programming 2 27th Apr 2009 03:43 PM
How to call user defined function (UDF) from custom menu in Excel2003? Dutch_Guy Microsoft Excel Programming 3 28th Feb 2008 03:59 PM
How to call a function of an user defined DLL from Excel? Davide Microsoft Excel Programming 3 9th May 2006 02:50 PM
Call GoalSeek from a user-defined-function =?Utf-8?B?TWFyaw==?= Microsoft Excel Programming 1 23rd Aug 2005 01:50 PM
Call user defined word vba function from C# AP Microsoft C# .NET 1 29th Oct 2003 11:53 PM


Features
 

Advertising
 

Newsgroups
 


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