A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Office » General Discussions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Bug in VBA Excel 2007?



 
 
Thread Tools Display Modes
  #1  
Old February 11th, 2010, 01:31 PM posted to microsoft.public.office.developer.vba,microsoft.public.office.misc
Jo[_9_]
external usenet poster
 
Posts: 2
Default Bug in VBA Excel 2007?

Hello,

I'm trying to migrate a macro Excel 2003 to 2007 and I have the
following problem:

When running the code below, Err.Number is always 9 while in 2003
Err.Number is 0:

Public Sub Test ()
Dim i As Long
On Error Resume Next
With ActiveSheet
For i = 1 To 100
. Cells (i, "A"). Value = i
If Err.Number = 0 Then
. Cells (i, "B"). Value = "OK"
Else
. Cells (i, "B"). Value = "KB (" & Err.Number & "-" &
Err.Description & ")"
End If
Err.Clear
Next
End With
End Sub

Is this a BUG VBA 2007 or is it my code that Bugged (in this case why
it works well in 2003?).

Thank you for your help.
  #2  
Old February 13th, 2010, 06:44 AM posted to microsoft.public.office.developer.vba,microsoft.public.office.misc
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Bug in VBA Excel 2007?

Hi Jo,

In Excel 2007, I get Err 0 - all cells in column B have 'OK'. Is you copy of Excel fully patched?

--
Cheers
macropod
[Microsoft MVP - Word]


"Jo" wrote in message ...
Hello,

I'm trying to migrate a macro Excel 2003 to 2007 and I have the
following problem:

When running the code below, Err.Number is always 9 while in 2003
Err.Number is 0:

Public Sub Test ()
Dim i As Long
On Error Resume Next
With ActiveSheet
For i = 1 To 100
. Cells (i, "A"). Value = i
If Err.Number = 0 Then
. Cells (i, "B"). Value = "OK"
Else
. Cells (i, "B"). Value = "KB (" & Err.Number & "-" &
Err.Description & ")"
End If
Err.Clear
Next
End With
End Sub

Is this a BUG VBA 2007 or is it my code that Bugged (in this case why
it works well in 2003?).

Thank you for your help.

  #3  
Old February 13th, 2010, 08:14 AM posted to microsoft.public.office.developer.vba,microsoft.public.office.misc
Jo[_9_]
external usenet poster
 
Posts: 2
Default Bug in VBA Excel 2007?

On 13 fév, 07:44, "macropod" wrote:
Hi Jo,

In Excel 2007, I get Err 0 - all cells in column B have 'OK'. Is you copy of Excel fully patched?

--
Cheers
macropod
[Microsoft MVP - Word]

"Jo" wrote in ...
Hello,


I'm trying to migrate a macro Excel 2003 to 2007 and I have the
following problem:


When running *the code below, Err.Number is always 9 while in 2003
Err.Number is 0:


Public Sub Test ()
*Dim i As Long
*On Error Resume Next
*With ActiveSheet
* *For i = 1 To 100
* * *. Cells (i, "A"). Value = i
* * *If Err.Number = 0 Then
* * * *. Cells (i, "B"). Value = "OK"
* * *Else
* * * *. Cells (i, "B"). Value = "KB (" & Err.Number & "-" &
Err.Description & ")"
* * *End If
* * *Err.Clear
* *Next
*End With
End Sub


Is this a BUG VBA 2007 or is it my code that Bugged (in this case why
it works well in 2003?).


Thank you for your help.


Hi,

Thank's for your answer.

You can see on this link http://www.cijoint.fr/cjlink.php?fil...cij52nqbN0.pdf
some informations about version and updates of my computer.

Best regards
  #4  
Old February 13th, 2010, 11:41 PM posted to microsoft.public.office.developer.vba,microsoft.public.office.misc
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Bug in VBA Excel 2007?

Hi Jo,

I am unable to tell from that link whether your version is fully updated - the minor numbers are different than mine, but that may
be because you are using: (a) a French-language installation; and (b) Office Standard (I have Office Professional - but the vba
components should be the same)

--
Cheers
macropod
[Microsoft MVP - Word]


"Jo" wrote in message ...
On 13 fév, 07:44, "macropod" wrote:
Hi Jo,

In Excel 2007, I get Err 0 - all cells in column B have 'OK'. Is you copy of Excel fully patched?

--
Cheers
macropod
[Microsoft MVP - Word]

"Jo" wrote in ...
Hello,


I'm trying to migrate a macro Excel 2003 to 2007 and I have the
following problem:


When running the code below, Err.Number is always 9 while in 2003
Err.Number is 0:


Public Sub Test ()
Dim i As Long
On Error Resume Next
With ActiveSheet
For i = 1 To 100
. Cells (i, "A"). Value = i
If Err.Number = 0 Then
. Cells (i, "B"). Value = "OK"
Else
. Cells (i, "B"). Value = "KB (" & Err.Number & "-" &
Err.Description & ")"
End If
Err.Clear
Next
End With
End Sub


Is this a BUG VBA 2007 or is it my code that Bugged (in this case why
it works well in 2003?).


Thank you for your help.


Hi,

Thank's for your answer.

You can see on this link http://www.cijoint.fr/cjlink.php?fil...cij52nqbN0.pdf
some informations about version and updates of my computer.

Best regards

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.