Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Using the Application.Caller function

Hello,

I am able to implement the following code successfully:
Dim RangeVariable As Range
Set RangeVariable = Application.Caller
Do While RangeVariable.Offset(0, 1).Value < ""

Note that the Do While condition tests for < "".

I am now trying to make a modification to assign a value, e.g.:
RangeVariable.Offset(0, 1).Value = "SomeText"

The code compiles but crashes without a hint.

Any ideas? Does the problem relate to a function being "gettable" but not
"settable", or maybe that's the wrong track?

Thanks.

Keith
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Using the Application.Caller function

You can't change cells with a function, only return a value to the "caller".
--
Gary''s Student - gsnu200840


"Keith Howard" wrote:

Hello,

I am able to implement the following code successfully:
Dim RangeVariable As Range
Set RangeVariable = Application.Caller
Do While RangeVariable.Offset(0, 1).Value < ""

Note that the Do While condition tests for < "".

I am now trying to make a modification to assign a value, e.g.:
RangeVariable.Offset(0, 1).Value = "SomeText"

The code compiles but crashes without a hint.

Any ideas? Does the problem relate to a function being "gettable" but not
"settable", or maybe that's the wrong track?

Thanks.

Keith

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Using the Application.Caller function


A function called directly or indirectly from a worksheet cell can
only return a value to the whence it was called. It cannot change any
part of the Excel environment, including the values of other cells.
This restriction is necessary to allow Excel to properly calculate
cells in the correct order.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

n Wed, 18 Mar 2009 11:51:13 -0700, Keith Howard
wrote:

Hello,

I am able to implement the following code successfully:
Dim RangeVariable As Range
Set RangeVariable = Application.Caller
Do While RangeVariable.Offset(0, 1).Value < ""

Note that the Do While condition tests for < "".

I am now trying to make a modification to assign a value, e.g.:
RangeVariable.Offset(0, 1).Value = "SomeText"

The code compiles but crashes without a hint.

Any ideas? Does the problem relate to a function being "gettable" but not
"settable", or maybe that's the wrong track?

Thanks.

Keith

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
application caller Rich Excel Programming 1 September 21st 06 07:48 PM
Row = Application.Caller.Row Charles Woll Excel Worksheet Functions 8 February 28th 05 02:04 PM
Application.Caller Mark Worthington Excel Programming 9 February 12th 04 07:32 PM
application.caller Jase Excel Programming 0 January 6th 04 03:51 AM
DDE and application.caller help Ross Kaminsky Excel Programming 1 July 17th 03 04:17 PM


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

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"