LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can Excel 2003 VBA work in Excel 2002?

Dear All

I undertook some programming in Excel 2003 but my new employer only uses
Excel 2002 (10.6823.6817) SP3. The hyperlinks, drop-down menus and
calcuations all seem to work fine but the program was written such that when
it was opened a box appeared asking for a password so that only the "It
Administrator" could get into it and amend it. This Userform no longer
appears and I keep getting a "compile error" box coming up when I navigate
between screens.

The code for the box asking for the password is given below. Is there any
way this will work in Excel 2002?

Thanks !

Private Sub CommandButton1_Click()
Unload UserForm14


Restart:
Dim UserName As String
Dim FirstSpace As Integer
Do Until UserName < ""
UserName = InputBox("Please enter your password: ", _
"IT Administrator Password")
Loop
FirstSpace = InStr(UserName, " ")
If FirstSpace < 0 Then
UserName = Left(UserName, FirstSpace - 1)
End If
If UserName = "keeppawsoff" Then
Application.ScreenUpdating = False
Worksheets("Setup").Activate
Range("B50") = "False"
Worksheets("Basic").Activate
Worksheets("Setup").Activate
Range("A1").Select
Application.ScreenUpdating = True
Exit Sub
End If

Ans = MsgBox("You have entered an incorrect password - Try again?",
vbRetryCancel, "IT Administrator Password")
Select Case Ans

Case vbRetry
UserName = ""
GoTo Restart

Case vbCancel
UserForm14.Show

End Select


End Sub

Private Sub CommandButton2_Click()
Application.ScreenUpdating = False

Worksheets("Setup").Activate
Range("B50") = "TRUE"

Unload UserForm14
Worksheets("Basic").Activate
Worksheets("Setup").Activate
Range("A1").Select
Application.ScreenUpdating = True
End Sub

Private Sub UserForm_Click()

End Sub

--
Adrian C
 
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
macro which works in excel 2000 does not work in excel 2002 nnayak Excel Programming 1 June 16th 06 03:13 PM
Simple Macro, works in Excel 2002, 2003 but won't work in 2000 DJA[_2_] Excel Programming 5 September 28th 05 05:10 PM
Excel 2000 VBA App Now Works in Excel 2003, but not Excel 2002 bobkaku Excel Programming 0 March 11th 05 02:07 AM
How do I update Excel 2000 macros to work in Excel 2002? BobPetrich Excel Discussion (Misc queries) 3 January 4th 05 04:06 PM
how do i work across workbooks in excel 2002? lesgold80 Excel Discussion (Misc queries) 1 January 4th 05 03:47 PM


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