Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default what's wrong with my friend ?

What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default what's wrong with my friend ?

I believe "friend" is reserved for Object modules.


"Gary''s Student" wrote in message
...
What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default what's wrong with my friend ?

Sound politically incorrect: Your skinny (string) friend is not too bright
(dim)
Sorry !
--
Bernard

"Gary''s Student" wrote in message
...
What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default what's wrong with my friend ?

Friend is a key word that is used to define scope in declaring procedures.

http://msdn2.microsoft.com/en-us/lib...59(vs.60).aspx
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default what's wrong with my friend ?

Thanks Jim.

VBA Help was strangely silent on the topic of friend.
--
Gary's Student
gsnu200709


"Jim Thomlinson" wrote:

Friend is a key word that is used to define scope in declaring procedures.

http://msdn2.microsoft.com/en-us/lib...59(vs.60).aspx
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default what's wrong with my friend ?

Dont apologize. I love quasi-puns.
--
Gary's Student
gsnu200709


"Bernard Liengme" wrote:

Sound politically incorrect: Your skinny (string) friend is not too bright
(dim)
Sorry !
--
Bernard

"Gary''s Student" wrote in message
...
What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default what's wrong with my friend ?

A property or method declared as "Friend" lets you call that property or
method from anywhere in the project, similar to Public, but unlike Public,
Friends are not exposed to the outside world.


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

"Gary''s Student" wrote in message
...
Thanks Jim.

VBA Help was strangely silent on the topic of friend.
--
Gary's Student
gsnu200709


"Jim Thomlinson" wrote:

Friend is a key word that is used to define scope in declaring
procedures.

http://msdn2.microsoft.com/en-us/lib...59(vs.60).aspx
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default what's wrong with my friend ?

Chip,
Would using Friend to declare a variable then be the equivalent of
declaring a variable as Public while also using Option Private Module?
Regards,
Jim Cone
San Francisco, USA



"Chip Pearson"
wrote in message
A property or method declared as "Friend" lets you call that property or
method from anywhere in the project, similar to Public, but unlike Public,
Friends are not exposed to the outside world.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default what's wrong with my friend ?

You have to go to the VB programming language reference, under keywords. It
does not pull up from regular help for some strange reason. There are
several of the keywords like that.

"Gary''s Student" wrote:

Thanks Jim.

VBA Help was strangely silent on the topic of friend.
--
Gary's Student
gsnu200709


"Jim Thomlinson" wrote:

Friend is a key word that is used to define scope in declaring procedures.

http://msdn2.microsoft.com/en-us/lib...59(vs.60).aspx
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

What's wrong with:

Dim friend as String
--
Gary''s Student
gsnu200709

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default what's wrong with my friend ?

On Tue, 6 Mar 2007 09:47:15 -0800, Gary''s Student
wrote:

Thanks Jim.

VBA Help was strangely silent on the topic of friend.


When I put my cursor on "friend", and selected F1, HELP for Friend popped up.

Friend


Modifies the definition of a procedure in a form module or class module to make
the procedure callable from modules that are outside the class, but part of the
project within which the class is defined. Friend procedures cannot be used in
standard modules.

Syntax

[Private | Friend | Public] [Static] [Sub | Function | Property] procedurename

The required procedurename is the name of the procedure to be made visible
throughout the project, but not visible to controllers of the class.

Remarks

Public procedures in a class can be called from anywhere, even by controllers
of instances of the class. Declaring a procedure Private prevents controllers
of the object from calling the procedure, but also prevents the procedure from
being called from within the project in which the class itself is defined.
Friend makes the procedure visible throughout the project, but not to a
controller of an instance of the object. Friend can appear only in form modules
and class modules, and can only modify procedure names, not variables or types.
Procedures in a class can access the Friend procedures of all other classes in
a project. Friend procedures don't appear in the type library of their class. A
Friend procedure can't be late bound.

--ron
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
trying to help a friend new2this New Users to Excel 1 May 6th 07 07:56 AM
A Little Favor for a Friend CompuWhiz Excel Programming 5 January 23rd 07 12:17 AM
combined HLOOKUP (urgent for a friend) tom ossieur Excel Worksheet Functions 6 August 9th 06 03:56 PM
Can't think tonight - for a friend, can you help? a Excel Programming 1 February 9th 05 07:05 AM
just broke up with girl friend we had puter together daniel_in_despert_need_of_excel Excel Programming 2 December 6th 04 04:24 AM


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