Why not use this as a lock object in lock

Hello!

According to the docs it says that lock (this) is a problem if the instance 
can be accessed publicly.
Can somebody explain what can happen if I have a lock section and use this 
as the lock object like this.
lock(this)
{

}

//Tony 


0
Tony
6/20/2010 3:09:34 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

12 Replies
1441 Views

Similar Articles

[PageSpeed] 1

On 2010-06-20 17:09, Tony Johansson wrote:
> According to the docs it says that lock (this) is a problem if the instance
> can be accessed publicly.
> Can somebody explain what can happen if I have a lock section and use this
> as the lock object like this.
> lock(this)
> {
>
> }
>
http://haacked.com/archive/2006/08/08/threadingneverlockthisredux.aspx

-- 
J.
0
Jeroen
6/20/2010 3:49:28 PM
On 20-06-2010 11:09, Tony Johansson wrote:
> According to the docs it says that lock (this) is a problem if the instance
> can be accessed publicly.
> Can somebody explain what can happen if I have a lock section and use this
> as the lock object like this.
> lock(this)
> {
>
> }

You can do it.

If someone else locks on the object you can risk a deadlock.

lock(this) has traditionally been frowned on in the .NET world
for that reason.

It is some theoretical bullshit.

Obviously you need to think about what you lock on, but
it is quite general in multithreaded programming that you
need to have the brain "on" not "off".

Arne

0
ISO
6/20/2010 5:03:24 PM
On 20-06-2010 11:49, Jeroen Mostert wrote:
> On 2010-06-20 17:09, Tony Johansson wrote:
>> According to the docs it says that lock (this) is a problem if the
>> instance
>> can be accessed publicly.
>> Can somebody explain what can happen if I have a lock section and use
>> this
>> as the lock object like this.
>> lock(this)
>> {
>>
>> }
>>
> http://haacked.com/archive/2006/08/08/threadingneverlockthisredux.aspx

Quote:

"A while ago I wrote that you should never lock a value type ..."

I think that gives a good indication of the technical level
of the advice.

Something like on a scale from 1 to 10 around -2.

:-)

Arne


0
UTF
6/20/2010 5:06:54 PM
Arne Vajhøj wrote:
> [...]
>> http://haacked.com/archive/2006/08/08/threadingneverlockthisredux.aspx
> 
> Quote:
> 
> "A while ago I wrote that you should never lock a value type ..."
> 
> I think that gives a good indication of the technical level
> of the advice. [...]

Perhaps you could be more specific.  The advice to never lock on a value 
type is actually very good advice, and for the reason the author states 
(value types are boxed, so you never get the same instance twice when 
using "lock" or other Monitor methods).

Or put another way, how high could the quality of advice be when given 
by someone who thinks locking on a value type is actually a good idea?

Pete
0
Peter
6/20/2010 6:45:42 PM
Arne Vajh�j wrote:
> On 20-06-2010 11:09, Tony Johansson wrote:
>> According to the docs it says that lock (this) is a problem if the 
>> instance
>> can be accessed publicly.
>> Can somebody explain what can happen if I have a lock section and use 
>> this
>> as the lock object like this.
>> lock(this)
>> {
>>
>> }
> 
> You can do it.
> 
> If someone else locks on the object you can risk a deadlock.
> 
> lock(this) has traditionally been frowned on in the .NET world
> for that reason.
> 
> It is some theoretical bullshit.

It's only "theoretical bullshit" in the same sense that all "best 
practices" advice in programming is "theoretical bullshit".

> Obviously you need to think about what you lock on, but
> it is quite general in multithreaded programming that you
> need to have the brain "on" not "off".

One could say the exact same thing about all of the various idioms, 
rules-of-thumb, etc. we use in programming.  Just the other day, you 
(correctly, IMHO) argued in favor of making fields private.  But as long 
as someone is careful, what's _really_ the problem with that?  None. 
It's just "theoretical bullshit" that exposing fields in your class 
could cause an issue.

The real problem is that it's not possible for any of us humans to be 
careful 100% of the time.  Our brains don't operate in a strictly "on" 
or "off" state; instead, different people have different capacities for 
avoiding mistakes, and even a given person has good days and bad days.

When one follows good advice, such as never locking on "this", it helps 
avoid certain classes of bugs.  Of course, there will always be other 
bugs that one can introduce.  But one might as well avoid the 
easy-to-avoid ones.

It's unfortunate that the author of the article used the example they 
did, because it's clearly contrived.  Who calls Monitor.Enter() on an 
object, and then just loses the reference to that object?  That's silly.

But it's still good advice to keep your locking objects private, so that 
one can ensure that when locking on an object, it's only ever being used 
for a lock in code that one has control over.  Concurrent programming is 
hard enough without making it even more difficult to reason about the 
state of your program.

So, don't make it more difficult to reason about the state of your 
program.  Encapsulate locking in exactly the same way you'd encapsulate 
data in fields, and it will be much easier to avoid certain kinds of bugs.

Frankly, you do the entire community a great disservice when you call 
good advice like that "bullshit".

Pete
0
Peter
6/20/2010 6:55:09 PM
On 20-06-2010 14:45, Peter Duniho wrote:
> Arne Vajhøj wrote:
>> [...]
>>> http://haacked.com/archive/2006/08/08/threadingneverlockthisredux.aspx
>>
>> Quote:
>>
>> "A while ago I wrote that you should never lock a value type ..."
>>
>> I think that gives a good indication of the technical level
>> of the advice. [...]
>
> Perhaps you could be more specific. The advice to never lock on a value
> type is actually very good advice,

Given that the C# compiler gives an error when attempting to
do it, then ...

Arne

0
UTF
6/20/2010 7:17:45 PM
Arne Vajhøj wrote:
> On 20-06-2010 14:45, Peter Duniho wrote:
>> Arne Vajhøj wrote:
>>> [...]
>>>> http://haacked.com/archive/2006/08/08/threadingneverlockthisredux.aspx
>>>
>>> Quote:
>>>
>>> "A while ago I wrote that you should never lock a value type ..."
>>>
>>> I think that gives a good indication of the technical level
>>> of the advice. [...]
>>
>> Perhaps you could be more specific. The advice to never lock on a value
>> type is actually very good advice,
> 
> Given that the C# compiler gives an error when attempting to
> do it, then ...

The "lock" statement is not the only way to lock (there is no error if 
you use the Monitor class directly), and the compiler error even when 
using the "lock" statement is easily bypassed simply by casting the 
variable to object.

Do not underestimate the ability of people to circumvent the compiler's 
attempts to keep you from doing some stupid.  The advice to not lock a 
value type is valid, whether or not the compiler tries to help you avoid 
doing it.

Pete
0
Peter
6/21/2010 5:09:52 AM
Arne Vajh�j wrote:
> [...]
> I have never seen or heard about a real world case where
> the lock on this has actually created a problem.

You certainly have an over-confident sense of the value of your own 
experiences as applying to every other programmer in existence.

The fact is, the question of using "this" for a lock is important enough 
that the implementation for compiler-generated event accessors was fixed 
in the C# 4.0 compiler so that it no longer locks on "this".

I'll take the experiences of those who are actually implementing .NET 
and the C# compiler over yours any day when it comes to answering 
questions about what's an important rule to follow or not when writing 
..NET code.

Pete
0
Peter
6/21/2010 5:16:25 AM
On 21-06-2010 01:09, Peter Duniho wrote:
> Arne Vajhøj wrote:
>> On 20-06-2010 14:45, Peter Duniho wrote:
>>> Arne Vajhøj wrote:
>>>> [...]
>>>>> http://haacked.com/archive/2006/08/08/threadingneverlockthisredux.aspx
>>>>
>>>> Quote:
>>>>
>>>> "A while ago I wrote that you should never lock a value type ..."
>>>>
>>>> I think that gives a good indication of the technical level
>>>> of the advice. [...]
>>>
>>> Perhaps you could be more specific. The advice to never lock on a value
>>> type is actually very good advice,
>>
>> Given that the C# compiler gives an error when attempting to
>> do it, then ...
>
> The "lock" statement is not the only way to lock (there is no error if
> you use the Monitor class directly),

The code example he gives is:

private bool isDisposed = false;

//... code...
~MyClass()
{
     lock(isDisposed)
     {
         if(!isDisposed)
         {
             //Do Stuff...
         }
     }
}

 >                                 and the compiler error even when
> using the "lock" statement is easily bypassed simply by casting the
> variable to object.

But in that case you are not really locking on a value type but
on the object containing the value.

> Do not underestimate the ability of people to circumvent the compiler's
> attempts to keep you from doing some stupid. The advice to not lock a
> value type is valid, whether or not the compiler tries to help you avoid
> doing it.

I am not denying that people can do silly things.

I am just saying that I have little respect for blog writers
that argue against writing code that does not even compile.

Arne

0
UTF
6/22/2010 2:41:03 AM
On 21-06-2010 01:16, Peter Duniho wrote:
> Arne Vajh�j wrote:
>> [...]
>> I have never seen or heard about a real world case where
>> the lock on this has actually created a problem.
>
> You certainly have an over-confident sense of the value of your own
> experiences as applying to every other programmer in existence.

When I write "seen or heard about" I do not limit it to
personal experience.

In fact I would not even use the term "heard about" for
personal experience.

So that observation is rather ridiculous.

> The fact is, the question of using "this" for a lock is important enough
> that the implementation for compiler-generated event accessors was fixed
> in the C# 4.0 compiler so that it no longer locks on "this".
>
> I'll take the experiences of those who are actually implementing .NET
> and the C# compiler over yours any day when it comes to answering
> questions about what's an important rule to follow or not when writing
> .NET code.

But now we are back at that this so called "best practice" is
not backed by any known examples - it is just assumed that
because some people have stated that then there must be some
reason behind it.

Writing software should be science/engineering not religion.

And it is as if there is a lack of real problems to look
for solutions for.

Arne
0
ISO
6/22/2010 2:51:03 AM
Arne Vajh�j wrote:
> On 21-06-2010 01:16, Peter Duniho wrote:
>> Arne Vajh�j wrote:
>>> [...]
>>> I have never seen or heard about a real world case where
>>> the lock on this has actually created a problem.
>>
>> You certainly have an over-confident sense of the value of your own
>> experiences as applying to every other programmer in existence.
> 
> When I write "seen or heard about" I do not limit it to
> personal experience.
> 
> In fact I would not even use the term "heard about" for
> personal experience.
> 
> So that observation is rather ridiculous.
> 
>> The fact is, the question of using "this" for a lock is important enough
>> that the implementation for compiler-generated event accessors was fixed
>> in the C# 4.0 compiler so that it no longer locks on "this".
>>
>> I'll take the experiences of those who are actually implementing .NET
>> and the C# compiler over yours any day when it comes to answering
>> questions about what's an important rule to follow or not when writing
>> .NET code.
> 
> But now we are back at that this so called "best practice" is
> not backed by any known examples

Known by you, you mean? What knowledge could you have that would 
preclude other people from knowing of real-life instances of this kind 
of locking problem that haven't come to your attention?

> - it is just assumed that
> because some people have stated that then there must be some
> reason behind it.

The reason is obvious: all you need is one programmer creating an object 
from your class and deciding that that object is a good thing to lock 
on, and it will screw up your entire, carefully tuned internal 
synchronization scheme based on a lock on that object. Why would you 
assume that in the entire past and entire future of the planet, this 
*wouldn't* happen?

> 
> Writing software should be science/engineering not religion.

Interesting philosophy: in order to avoid treating software creation as 
a religion, one should avoid all practices that would be best practices 
IF failure to follow them would ever lead to a problem, IF one places 
one's faith in the proposition that on the contrary, failure to follow 
them will never lead to a problem. The problem is that *that* philosophy 
sounds like a religion.
0
Harlan
6/22/2010 4:50:09 AM
On 22-06-2010 00:50, Harlan Messinger wrote:
> Arne Vajh�j wrote:
>> On 21-06-2010 01:16, Peter Duniho wrote:
>>> The fact is, the question of using "this" for a lock is important enough
>>> that the implementation for compiler-generated event accessors was fixed
>>> in the C# 4.0 compiler so that it no longer locks on "this".
>>>
>>> I'll take the experiences of those who are actually implementing .NET
>>> and the C# compiler over yours any day when it comes to answering
>>> questions about what's an important rule to follow or not when writing
>>> .NET code.
>>
>> But now we are back at that this so called "best practice" is
>> not backed by any known examples
>
> Known by you, you mean?

Yes.

>                          What knowledge could you have that would
> preclude other people from knowing of real-life instances of this kind
> of locking problem that haven't come to your attention?

I am following 5 different .NET forums for many years. I have
never seen a problem posted.

But feel free to post a bunch of links to cases of problems.

BTW, I think I have already suggested that a couple of
times.

Either people here want to keep it a secret from me or
they don't know any cases either.

>> - it is just assumed that
>> because some people have stated that then there must be some
>> reason behind it.
>
> The reason is obvious: all you need is one programmer creating an object
> from your class and deciding that that object is a good thing to lock
> on, and it will screw up your entire, carefully tuned internal
> synchronization scheme based on a lock on that object. Why would you
> assume that in the entire past and entire future of the planet, this
> *wouldn't* happen?

I hope that it would happen!

Some code in a method in the class have to modify some state of the 
object and lock on the object.

Some other code outside the class have to modify the state of
the object and lock on the object.

Sure they interact.

But that is desired behavior.

Having the internal code lock on another object could
result in data corruption.

In general I prefer the risk of a deadlock over the risk
of data corruption.

If somebody don't believe in that, then there are a very simple
solution: just don't use any locks at all.

>> Writing software should be science/engineering not religion.
>
> Interesting philosophy: in order to avoid treating software creation as
> a religion, one should avoid all practices that would be best practices
> IF failure to follow them would ever lead to a problem, IF one places
> one's faith in the proposition that on the contrary, failure to follow
> them will never lead to a problem. The problem is that *that* philosophy
> sounds like a religion.

I am not quite sure that I understand that long sentence.

Basing best practices on real problems not something that you have
heard from someone that have heard from someone is engineering
not religion.

As demonstrated above then you assumption about following the
practice will never lead to a problem is simply wrong.

(and I think we can find examples where locking on different
objects has resulted in data corruption - that is not theoretical)

Arne

0
ISO
6/29/2010 2:29:16 AM
Reply:

Similar Artilces:

How to use a DLL!?
Hi all, according with your experince: 1. I'm exporting class functions from DLL instead of global function, is there something i've to check!? 2. I need to run a DLL func in a separate thread, at moment the app create the thread and exec this func. I actually prefer the DLL to start the thread, any problems doing so!? Thanks you all!! Ale ...

No results using DateDiff
I am working with DateDiff . I get no error messages but also do not get any results in my calculated field. I have two dates, START_DATE and END_DATE and I need to know the number of days between them. START_DATE and END_DATE are both Date/Time type with a Short Date format. I am working in the QBE grid to write the query. I select an empty column and put my DateDiff calculation on the line below Or: in the Criteria area. I have tried: [END_DATE]-[START_DATE] and DateDiff("d",[START_DATE],[STOP_DATE]) Both approaches ask for parameter values for Time and STOP_DATE. If I d...

Transfer Files Using VBA
Hi, I'd like to transfer files from several drives on my pc to one cetnral location. From A:\Office1\ B:\Office2\ C:\Office3\ To D:\HeadQuarters\ My routine now is the following 1) Copy the files from drives: A, B, and C; and then 2) Paste the filesto the D drive 3) Delete the files permanently from drives A, B, and C. As you see this is a tedious routine, which I'd liket o avoid by using VBA. Can someone start me off with some code on how to accomplish this. Thanks so much in advance! Jrew Jrew, You could create a batch file (from the olden days) using XCOPY and desired bel...

How to use excel file created in version earlier than 4.0a in 4.0
Thanks to whomever answered my query but when I opened the email the screen was blank. My laptop is sick. My question was and still is, how can I use my Excel files created in a recent version on my laptop in my PC which is loaded only with Excel 4.0a . Please and thanks. -- Thanks, Ajimmo Hi Ajimmo You can't, the file format changes twice since version 4. You need a newer Excel version, a compatible spreadsheet program, or simply a viewer if all you want to do is view / print the file. HTH. Best wishes Harald "ajimmo" <ajimmo@discussions.microsoft.com> skrev i m...

Issue when using Outlook 2003 on Exchange 5.5 SP4
Hi! I have seen issues on using Outlook 2003 on MS Exchange 5.5 SP4. Can anyone guide me on how to handle this? M P What issues have you seen? -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "M P" <mark@textguru.ph> wrote in message news:eoqSaBjTGHA.5884@TK2MSFTNGP14.phx.gbl... > Hi! > > I have seen issues on using Outlook 2003 on MS Exchange 5.5 SP4. Can > anyone guide me on how to handle this? > > M P > It was pretty easy for me to find this in the Microsoft Knowledge Base: http://support.microsoft...

Use of subkeys in SetRegistryKey
The following code causes ini settings to be stored in HKEY_CURRENT_USER\Software\Company\Product Group\<application name> \<section name>\<value name> SetRegistryKey("Company\\Product Group"); This is what I want it to do, but there is nothing in the documentation to say that this should work. Is this unsupported behaviour that may not work in future windows versions or supported but undocumented behaviour? Thanks <dimstthomas@yahoo.com> wrote in message news:1190714009.923549.98910@k79g2000hse.googlegroups.com... > The following code causes ini sett...

Excel --- Physical dimensions of a chart object
Is there a way to know the physical dimensions of a chart object on a worksheet? I have data in several worksheets and I would like all my charts to be of the same size (obviously this means that data with a smaller range of values will be more spread out than data with a larger range of values). Thanks, Nimmi This is just an example: Sub Macro2() ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartArea.Select n = ActiveSheet.Shapes("Chart 1").Width m = ActiveSheet.Shapes("Chart 1").Height MsgBox (n & " BY " & m...

'Recently used file' list.
When I open Excel nine filenames appear on the RHS as 'recently used files' (this number was set via Tools/Options/General, of course). In the middle of this list are 3 no-longer-used files. Though the files themselves have been deleted their names remain in this list. Is there an easy way to remove those entries from that list, please? TIA, DB. There is an entry in the help file "Display or hide recently used workbooks on the File menu" which says uncheck the 'recently used files' checkbox, the click OK. Then, basically, start again. "DB.&...

Using Outlook with a VPN
Yesterday i set up a VPN so as to allow our employees to work from home, today one of the employees highlighted a problem with it though. When connected through the vpn, they are unable to access their Outlook emailand insted have to disconnect and then access through a normal dial-up. Any thoughts? Many Thanks Try this. When you get the VPN login screen, choose Properties. On the Options tab, check the box next to Include Windows logon Domain. That helped me. Bob >-----Original Message----- >Yesterday i set up a VPN so as to allow our employees to >work f...

Frustrated Beyond Measure
I loved Money 2005, recommended it to friends and got 2 great years of use out of it. Then, it forced me to upgrade to continue online services. I didn't mind since it was only $40 and I got two good years out of it. However, Money Plus Deluxe has been a nuisance. I have never gotten portfolio manager to work. I spent 2 weeks sending emails with support where the guy eventually said "if this doesn't work, I can't help you." Great... shoudl I go buy Quicken? This weekend, I decided to try to completely uninstall Money and try a reinstall to get Portfolio Manag...

Exchange no longer available
Courtesy of Katrina, my brother-in-law's job and Exchange server are no more. He knows he has personal folders and contacts on his laptop, but Outlook choles on not connecting to Exchange and won't let him see the local stuff either. How does one tell Outlook not to try to connect to Exchange and instead use the local pst file? It might be easier to create a new profile and then use File Open to access the personal folder file, you create a new profile in Control Panel || Mail <philmcin@yahoo.com> wrote in message news:1126736961.961262.92120@g43g2000cwa.googlegroups.com... ...

Solution: Error 2306: There are too many rows to output (Access to Excel using OutputTo)
I've joined the legions who've encountered this problem with the OutputTo method in Access: Run-time error 2306 There are too many rows to output, based on the limitation specified by the output format or by Microsoft Access A lot of people seem to have encountered it. The reason is because OutputTo defaults to an old version of Excel which only allows 16K rows A lot of people also suggest using TransferSpreadsheet instead, but that caused me a lot more problems (putting a single quote in front of my text data) Intellisense for the command does not list what your options are for th...

having problems using performanceCouter
hi, i've made a program that shows the CPU idle time using the performance counter, using Visual C# . however, from some reason, it works on any computer other than my home PC . i've searched on the net but couldn't find what causes it. what i get is an exception that if is not caught, closes the program. here's a picture of what i get while debugging: http://img294.yfrog.com/i/picture20091211182403.png/ what i think is that maybe some service of windows (that the performance counter needs) doesn't work well(or is just disabled) . my computer runs on Windo...

different versions in visio ole-object?
hello i have some problems printing a word document which includes some visio drawingns. In word i can see the visio object like i edited it but when printing the word-document, a completly old version of the visio object is printed out. The printed object is older that 2 weeks. I tryed printing the document from other PC without changes. I tryed copying the ole-object into an other word dokument (copy/paste) without changes. Printing the document from wordpad works great .... I also opened the visio object (doublecklick in word) and edited the object, saved the file and exited back to wo...

Using Jet to read excel file returns blank for last cell
With VB6 I am opening an Excel file to query the contents using ADO. I am then using the contents of the worksheet to create a format file that is used for a bulk insert into SQL Server. We designed the program this way so that users can use a spreadsheet to import data in any format they want and process the data based on values set in the spreadsheet. This keeps us from having to design new tables and format files for new record layouts which come down pretty often. Everything works fine usually. There is just one perculiarity that is happening with the Excel file. Sometimes, th...

Identifying LOCKED cells
Is there a way to identify locked cells, other than going through the processof looking at each cell's format? Here's by quandry. I am working a worksheet which has both locked and unlocked cells. Unfortunately some of the locked cells should be unlocked so that data can be input. Thanks for your help To reply to this message, remove "mand" from my address. Thanks I've dragged the lock button onto a toolbar. When I click on a cell, I can glance at that and see if it's depressed (not suicidal!) or not. Tools|Customize|Commands Tab|Format category. Look for "Lo...

using screen...
Hi, I have problem with the query in the cascade combobox when the form name change. Is there a way to replace the following using screen.activeform [Forms]![frmCoFundReview]![Partner] => screen.activeform.[Partner] ? SF Not that I know. You could use a separate query for each form. Each query would have the correct form name for the combo box. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "SF" <samnangs@pactcambodia.org> wrote in message news:u%23z%23g6iyKHA.2644@TK2MSFTNGP04.phx.gbl... > Hi, > > I have probl...

e-mail is locked or down for maintenance, what to do?
I received an error message: Microsoft Office Outlook is locked or down for maintenance. unable to access mail for two days. How do I unlock or what is to be done Is this a work account? If yes, then ask your mail admin. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After furious head scratching, La Condesa asked: | I received an error message: Microsoft Office Outlook is locked or | down for maintenance. unable to ...

Sending page by e-mail locks up computer
IE 6, Outlook 2000, Windows 2000 Professional. Each time I send a web page by e-mail to someone using Outlook, the e-mail goes through fine to my recipients, but my computer locks up. Eventually, I manage to close everything down via the task manager (and that too takes a while to get to), and then I have to reboot to regain access to Outlook. This, too, first has to be done in the safe mode so that the open mailbox can be closed up, and then I can get back to my normal operations by logging out and loggin back in. Can someone please help witth what settings I should look at either...

HELP! Microsoft.Crm.Platform.Proxy is not intended for direct use, please use the public SDK.
Can someone post the following DLL's from CRM 1.2? They should be on the installation CD. If you want to e-mail send to robert[at] ockhamgroup.com Microsoft.Crm.Platform.Proxy.dll (1.2.3297.0) Microsoft.Crm.Platform.Types.dll (1.2.3297.0) Details... I'm attempting the following solution: Moving External Data into Microsoft CRM: Lead Generation http://msdn2.microsoft.com/en-us/library/ms913871.aspx http://download.microsoft.com/download/e/4/5/e45c4994-6878-4871- 8699-6793b8f13c34/leadgeneration.exe What I need is either: 1. a working compiled LeadGenerator.exe executable; o...

In Word how to use Outlook, Excel
I am using Word 2007. How can I access Outlook contacts or Excel documents from Word -- Thank you in advance for your support and suggestions To access Outlook contacts, Outlook must be your default e-mail application in Windows. You can then use Insert Address (which you can add to the QAT (Quick Access Toolbar) . What is it that you want to access from Excel? If you need to look something up in Excel and enter it into a document, you will need a macro. You can however use edit paste special to insert Excel cells copied to the clipboard. -- <>>< ><<...

Cannot use default SMTP Virtual Server
Hello All, I this problem since yesterday Actually I post this already and get some reply but that doesnt solve it. Again my problem is: I have newly setuo exhcange 2003 (SBS 2003) everythng works fine until I test for open relay (using telnet om port 25) and found that it was indeed open. So I check KB and follow intruction to allo only this IP block to relay mail 192.168.0.0 255.255.255.0 but when I try to telnet again the server on port 25 I cannot connecto it anymore. I restarted the service even the server itself but still I cannot connect to it. NOTE: I can connect with port...

OWA using a new Web Site
I have recently Installed SBS 2000, by default OWA is operational from the default web site. I have created several new sites in IIS and created the necessary virtual directories to gain access to the exchange mail server. However when I try to go in via a web browser I get the folder/file listing view in IE rather than the templates. All of the settings between the default virtual folders and the domain I wish to use are the same and I am stumped. I can still access the template from the server by going to the address http://localhost/Exchange at the server Any assistance would be apprec...

How to use InputBox for passphrase entry?
Ostensibly, I would like to use InputBox (or the equivalent) to enter a passphrase for an encryption algorithm. The problem: the passphrase is normally in the clear when typing in the InputBox field. Is there some way to cause the system to echo "*" or the equivalent for each character as they are typed? On Feb 8, 2:22=A0pm, "Joe User" <joeu2004> wrote: > Ostensibly, I would like to use InputBox (or the equivalent) to enter a > passphrase for an encryption algorithm. =A0The problem: =A0the passphrase= is > normally in the clear when typin...

Can I use solver functions in a protected (locked) worksheet?
I am using the solver function to optimize a blend of products. I want to lock (protect) some areas of the worksheet, but when doing so the solver function will not work and the following translated message arrives: The active document is not a worksheet, is protected or shared. Hope someone can help me. Thank you. Niels ...