Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default what's diferent in vba between 2002 & 2003

an exel file with macro made by excel 2002.i use excel 2003 opent it, it's
fine, but if i save as this file -even I didn't do any change with this file,
it will can't work under excel 2002 anymore,the macro can't run properly. any
one can help me?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default what's diferent in vba between 2002 & 2003

Posting the line the code halts on would probably go a long way towards
solving your problem.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"lasso" wrote:
| an exel file with macro made by excel 2002.i use excel 2003 opent it, it's
| fine, but if i save as this file -even I didn't do any change with this
file,
| it will can't work under excel 2002 anymore,the macro can't run properly.
any
| one can help me?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default what's diferent in vba between 2002 & 2003

Hi Dave,
thanks your reply.

I paste the code here.

Private Sub Workbook_Activate()

Call CreateMenu

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Call DeleteMenu

End Sub

Private Sub Workbook_Deactivate()

Call DeleteMenu

End Sub

Private Sub Workbook_Open()

Dim R As Integer
Dim AU As String

On Error GoTo Nothing_Happen

Application.CommandBars("Reviewing").Visible = False

AU = Replace(Trim(UCase(Application.UserName)), " ", "")
R = ActiveSheet.UsedRange.Rows.Count

Sheets("To_Be_Arrange").Select

For I = 1 To R
If Replace(Trim(UCase(Cells(I, 11))), " ", "") = AU Then
Selection.AutoFilter Field:=11, Criteria1:=Cells(I, 11)
Range("A1:N" & CStr(R)).Sort Key1:=Range("L2"),
Order1:=xlAscending, Key2:=Range _
("D2"), Order2:=xlAscending, Key3:=Range("A2"),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Range("A1").Select
End
Else
End If
Next I

Nothing_Happen:

If Cells(1, 1) < "" Then
Selection.AutoFilter Field:=11
Range("A1").Select
Else
End
End If

End Sub

"Dave Patrick" wrote:

Posting the line the code halts on would probably go a long way towards
solving your problem.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"lasso" wrote:
| an exel file with macro made by excel 2002.i use excel 2003 opent it, it's
| fine, but if i save as this file -even I didn't do any change with this
file,
| it will can't work under excel 2002 anymore,the macro can't run properly.
any
| one can help me?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default what's diferent in vba between 2002 & 2003

The actual line and the error generated would also be a big help.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"lasso" wrote:
| Hi Dave,
| thanks your reply.
|
| I paste the code here.
|
| Private Sub Workbook_Activate()
|
| Call CreateMenu
|
| End Sub
|
| Private Sub Workbook_BeforeClose(Cancel As Boolean)
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Deactivate()
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Open()
|
| Dim R As Integer
| Dim AU As String
|
| On Error GoTo Nothing_Happen
|
| Application.CommandBars("Reviewing").Visible = False
|
| AU = Replace(Trim(UCase(Application.UserName)), " ", "")
| R = ActiveSheet.UsedRange.Rows.Count
|
| Sheets("To_Be_Arrange").Select
|
| For I = 1 To R
| If Replace(Trim(UCase(Cells(I, 11))), " ", "") = AU Then
| Selection.AutoFilter Field:=11, Criteria1:=Cells(I, 11)
| Range("A1:N" & CStr(R)).Sort Key1:=Range("L2"),
| Order1:=xlAscending, Key2:=Range _
| ("D2"), Order2:=xlAscending, Key3:=Range("A2"),
| Order3:=xlAscending, _
| Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
| xlTopToBottom, DataOption1:=xlSortNormal,
| DataOption2:=xlSortNormal, _
| DataOption3:=xlSortNormal
| Range("A1").Select
| End
| Else
| End If
| Next I
|
| Nothing_Happen:
|
| If Cells(1, 1) < "" Then
| Selection.AutoFilter Field:=11
| Range("A1").Select
| Else
| End
| End If
|
| End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default what's diferent in vba between 2002 & 2003

if I run this macro under excel 2002, Microsoft visual basic shows the
message: Can't find project or library.
the error line is in "Private Sub Work_Open()" at "UCase"

P.S this macro is fine under excel 2003.

I gusee it maybe cause by different VBA location between 2003 & 2002 .



"Dave Patrick" wrote:

The actual line and the error generated would also be a big help.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"lasso" wrote:
| Hi Dave,
| thanks your reply.
|
| I paste the code here.
|
| Private Sub Workbook_Activate()
|
| Call CreateMenu
|
| End Sub
|
| Private Sub Workbook_BeforeClose(Cancel As Boolean)
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Deactivate()
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Open()
|
| Dim R As Integer
| Dim AU As String
|
| On Error GoTo Nothing_Happen
|
| Application.CommandBars("Reviewing").Visible = False
|
| AU = Replace(Trim(UCase(Application.UserName)), " ", "")
| R = ActiveSheet.UsedRange.Rows.Count
|
| Sheets("To_Be_Arrange").Select
|
| For I = 1 To R
| If Replace(Trim(UCase(Cells(I, 11))), " ", "") = AU Then
| Selection.AutoFilter Field:=11, Criteria1:=Cells(I, 11)
| Range("A1:N" & CStr(R)).Sort Key1:=Range("L2"),
| Order1:=xlAscending, Key2:=Range _
| ("D2"), Order2:=xlAscending, Key3:=Range("A2"),
| Order3:=xlAscending, _
| Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
| xlTopToBottom, DataOption1:=xlSortNormal,
| DataOption2:=xlSortNormal, _
| DataOption3:=xlSortNormal
| Range("A1").Select
| End
| Else
| End If
| Next I
|
| Nothing_Happen:
|
| If Cells(1, 1) < "" Then
| Selection.AutoFilter Field:=11
| Range("A1").Select
| Else
| End
| End If
|
| End Sub





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default what's diferent in vba between 2002 & 2003

UCase didn't change.

On the offending pc, open that workbook, go to the VBE, select your project.

Then look under Tools|References
Look for MISSING

Remove that reference (or replace it with one that exists)

lasso wrote:

if I run this macro under excel 2002, Microsoft visual basic shows the
message: Can't find project or library.
the error line is in "Private Sub Work_Open()" at "UCase"

P.S this macro is fine under excel 2003.

I gusee it maybe cause by different VBA location between 2003 & 2002 .

"Dave Patrick" wrote:

The actual line and the error generated would also be a big help.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"lasso" wrote:
| Hi Dave,
| thanks your reply.
|
| I paste the code here.
|
| Private Sub Workbook_Activate()
|
| Call CreateMenu
|
| End Sub
|
| Private Sub Workbook_BeforeClose(Cancel As Boolean)
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Deactivate()
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Open()
|
| Dim R As Integer
| Dim AU As String
|
| On Error GoTo Nothing_Happen
|
| Application.CommandBars("Reviewing").Visible = False
|
| AU = Replace(Trim(UCase(Application.UserName)), " ", "")
| R = ActiveSheet.UsedRange.Rows.Count
|
| Sheets("To_Be_Arrange").Select
|
| For I = 1 To R
| If Replace(Trim(UCase(Cells(I, 11))), " ", "") = AU Then
| Selection.AutoFilter Field:=11, Criteria1:=Cells(I, 11)
| Range("A1:N" & CStr(R)).Sort Key1:=Range("L2"),
| Order1:=xlAscending, Key2:=Range _
| ("D2"), Order2:=xlAscending, Key3:=Range("A2"),
| Order3:=xlAscending, _
| Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
| xlTopToBottom, DataOption1:=xlSortNormal,
| DataOption2:=xlSortNormal, _
| DataOption3:=xlSortNormal
| Range("A1").Select
| End
| Else
| End If
| Next I
|
| Nothing_Happen:
|
| If Cells(1, 1) < "" Then
| Selection.AutoFilter Field:=11
| Range("A1").Select
| Else
| End
| End If
|
| End Sub




--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default what's diferent in vba between 2002 & 2003

thanks Dave for your great help.
now the problem is solved under your suggesstion.
I removed the missing office 11 library.
does this often occur with 2003 to 2002?

thankssssssssss again to DAVE11111111

"Dave Peterson" wrote:

UCase didn't change.

On the offending pc, open that workbook, go to the VBE, select your project.

Then look under Tools|References
Look for MISSING

Remove that reference (or replace it with one that exists)

lasso wrote:

if I run this macro under excel 2002, Microsoft visual basic shows the
message: Can't find project or library.
the error line is in "Private Sub Work_Open()" at "UCase"

P.S this macro is fine under excel 2003.

I gusee it maybe cause by different VBA location between 2003 & 2002 .

"Dave Patrick" wrote:

The actual line and the error generated would also be a big help.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"lasso" wrote:
| Hi Dave,
| thanks your reply.
|
| I paste the code here.
|
| Private Sub Workbook_Activate()
|
| Call CreateMenu
|
| End Sub
|
| Private Sub Workbook_BeforeClose(Cancel As Boolean)
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Deactivate()
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Open()
|
| Dim R As Integer
| Dim AU As String
|
| On Error GoTo Nothing_Happen
|
| Application.CommandBars("Reviewing").Visible = False
|
| AU = Replace(Trim(UCase(Application.UserName)), " ", "")
| R = ActiveSheet.UsedRange.Rows.Count
|
| Sheets("To_Be_Arrange").Select
|
| For I = 1 To R
| If Replace(Trim(UCase(Cells(I, 11))), " ", "") = AU Then
| Selection.AutoFilter Field:=11, Criteria1:=Cells(I, 11)
| Range("A1:N" & CStr(R)).Sort Key1:=Range("L2"),
| Order1:=xlAscending, Key2:=Range _
| ("D2"), Order2:=xlAscending, Key3:=Range("A2"),
| Order3:=xlAscending, _
| Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
| xlTopToBottom, DataOption1:=xlSortNormal,
| DataOption2:=xlSortNormal, _
| DataOption3:=xlSortNormal
| Range("A1").Select
| End
| Else
| End If
| Next I
|
| Nothing_Happen:
|
| If Cells(1, 1) < "" Then
| Selection.AutoFilter Field:=11
| Range("A1").Select
| Else
| End
| End If
|
| End Sub




--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default what's diferent in vba between 2002 & 2003

If you have a reference to something that is office 2003 related
(office/word/powerpoint/access/outlook), then try to run it on a pc that doesn't
have office 2003, you'll have trouble.

But the same thing will happen if you use references to 2002 and run it on xl2k
(or references to 2k and use xl97).

I think most people will use late binding to make sure that their code uses the
version that exists on the pc that runs the program.


lasso wrote:

thanks Dave for your great help.
now the problem is solved under your suggesstion.
I removed the missing office 11 library.
does this often occur with 2003 to 2002?

thankssssssssss again to DAVE11111111

"Dave Peterson" wrote:

UCase didn't change.

On the offending pc, open that workbook, go to the VBE, select your project.

Then look under Tools|References
Look for MISSING

Remove that reference (or replace it with one that exists)

lasso wrote:

if I run this macro under excel 2002, Microsoft visual basic shows the
message: Can't find project or library.
the error line is in "Private Sub Work_Open()" at "UCase"

P.S this macro is fine under excel 2003.

I gusee it maybe cause by different VBA location between 2003 & 2002 .

"Dave Patrick" wrote:

The actual line and the error generated would also be a big help.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"lasso" wrote:
| Hi Dave,
| thanks your reply.
|
| I paste the code here.
|
| Private Sub Workbook_Activate()
|
| Call CreateMenu
|
| End Sub
|
| Private Sub Workbook_BeforeClose(Cancel As Boolean)
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Deactivate()
|
| Call DeleteMenu
|
| End Sub
|
| Private Sub Workbook_Open()
|
| Dim R As Integer
| Dim AU As String
|
| On Error GoTo Nothing_Happen
|
| Application.CommandBars("Reviewing").Visible = False
|
| AU = Replace(Trim(UCase(Application.UserName)), " ", "")
| R = ActiveSheet.UsedRange.Rows.Count
|
| Sheets("To_Be_Arrange").Select
|
| For I = 1 To R
| If Replace(Trim(UCase(Cells(I, 11))), " ", "") = AU Then
| Selection.AutoFilter Field:=11, Criteria1:=Cells(I, 11)
| Range("A1:N" & CStr(R)).Sort Key1:=Range("L2"),
| Order1:=xlAscending, Key2:=Range _
| ("D2"), Order2:=xlAscending, Key3:=Range("A2"),
| Order3:=xlAscending, _
| Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
| xlTopToBottom, DataOption1:=xlSortNormal,
| DataOption2:=xlSortNormal, _
| DataOption3:=xlSortNormal
| Range("A1").Select
| End
| Else
| End If
| Next I
|
| Nothing_Happen:
|
| If Cells(1, 1) < "" Then
| Selection.AutoFilter Field:=11
| Range("A1").Select
| Else
| End
| End If
|
| End Sub




--

Dave Peterson


--

Dave Peterson
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
diferent names Alexandra Lopes Excel Worksheet Functions 2 March 11th 09 03:30 PM
Problems between 2002/2003 Brenda from Michigan Excel Discussion (Misc queries) 5 January 12th 09 08:47 PM
version 2002 Vs 2003 kikitinoq Excel Discussion (Misc queries) 0 July 31st 06 09:44 PM
VBA and 2002/2003/2000 Bill Sturdevant[_2_] Excel Programming 3 April 20th 05 03:24 PM
DDE very slow with Excel 2002, 2003 Alexandre Nikolov Excel Programming 0 December 23rd 03 12:59 PM


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