Re: 2005 too smart for it's own good?
- From: v-lliu@xxxxxxxxxxxxxxxxxxxx (Linda Liu [MSFT])
- Date: Thu, 21 Sep 2006 09:24:31 GMT
Hi Cj,
I performed a test based on your sample code and did see the problem. When
the line of code 'oWB.Worksheets(x).delete()' is just highlighted, it has
been executed.
I think this problem is caused by the 'style' of this line of code. If I
replace this line of code with the following code,
Dim oWS As Work***
oWS = oWB.Worksheets(x)
oWS.Delete()
all works fine. When the this line of code 'oWS.Delete()' is just
highlighted, it isn't executed. It's after I press F11 that this line of
code is executed.
It is recommended to declare each object as a new variable when we automate
a Microsoft Office application from Microsoft Visual Basic .NET or
Microsoft Visual C#. Otherwise, it may cause some exceptional errors, e.g
Office application does not quit after automation from Visual Studio .NET
client (you could visit the link
'http://support.microsoft.com/kb/317109/en-us' to get more information on
this error).
As for your second question, it seems that you have renamed the directory
of the solution, which is correct. However, make sure that the path
'C:\Documents and Settings\cj\My Documents\Visual Studio
2005\Projects\test' is the right directory of the previous solution.
Hope this helps.
Sincerely,
Linda Liu
Microsoft Online Community Support
.
- Follow-Ups:
- References:
- 2005 too smart for it's own good?
- From: cj
- RE: 2005 too smart for it's own good?
- From: Linda Liu [MSFT]
- Re: 2005 too smart for it's own good?
- From: cj
- 2005 too smart for it's own good?
- Prev by Date: Re: Problem Adding new record to a database
- Next by Date: Re: Question in re LIKE in VB 2005
- Previous by thread: Re: 2005 too smart for it's own good?
- Next by thread: Re: 2005 too smart for it's own good?
- Index(es):