Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple VBA code in .xlsm File Hangs Excel 2003 Users

Status
Not open for further replies.

Lynne228

MIS
Jul 11, 2001
17
0
0
CA
I recently converted all my .xls files with simple VBA code (macros hiding/showing sheets) to .xlsm files. Now the users with Excel 2003 cannot open these files using the MS converter. They can open .xlsm files without the code, but not with. I tried removing file open passwords, removing VBA security passwords, etc. to no avail. Any suggestions? Thanks...
 


please post an example of your code. We have run with mixed 2003/2007 .xlsm, without significant issues.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
ThisWorkbook"
Private Sub Workbook_Open()
HideSheet
End Sub

"Home" Sheet
Public Sub CommandButton1_Click()
GetPassWord
If PW = "" Then Exit Sub
ShowSheet
End Sub

"Module 1"
Public PW As String

Sub HideSheet()

Sheets("Sheet1").Visible = xlSheetVeryHidden
Sheets("Sheet2").Visible = xlSheetVeryHidden
Sheets("Sheet3").Visible = xlSheetVeryHidden
Sheets("Sheet4).Visible = xlSheetVeryHidden
Sheets("Sheet5").Visible = xlSheetVeryHidden
Sheets("Sheet6").Visible = xlSheetVeryHidden
Sheets("Sheet7").Visible = xlSheetVeryHidden
End Sub

Public Sub ShowSheet()

Select Case PW
Case "pw1"
HideSheet
Sheets("Sheet1").Visible = True
Sheets("Sheet2").Select
Case "pw2"
HideSheet
Sheets("Sheet3").Visible = True
Sheets("Sheet3").Select
Case "pw3"
HideSheet
Sheets("Sheet4").Visible = True
Sheets("Sheet5").Visible = True
Sheets("Sheet5").Select
Case "pw4"
HideSheet
Sheets("Sheet6").Visible = True
Sheets("Sheet6").Select
Case "pw5"
Sheets("Sheet1").Visible = True
Sheets("Sheet2").Visible = True
Sheets("Sheet3").Visible = True
Sheets("Sheet4").Visible = True
Sheets("Sheet5").Visible = True
Sheets("Sheet6").Visible = True
Sheets("Sheet7").Visible = True
Sheets("Sheet1").Select

Case Else
MsgBox "Password not found. Try again please."
End Select

End Sub

Public Sub GetPassWord()
PW = InputBox("Enter the password to see your sheets", "Password")
End Sub





 

[red]TILT!!![/red]
Code:
Sub HideSheet()

Sheets("Sheet1").Visible = xlSheetVeryHidden
Sheets("Sheet2").Visible = xlSheetVeryHidden
Sheets("Sheet3").Visible = xlSheetVeryHidden[b][red]
Sheets("Sheet4).Visible = xlSheetVeryHidden[/red][/b]
Sheets("Sheet5").Visible = xlSheetVeryHidden
Sheets("Sheet6").Visible = xlSheetVeryHidden
Sheets("Sheet7").Visible = xlSheetVeryHidden
End Sub
[red]Missing closing QUOTE![/red]

Furthermore, you cannot have ALL sheets hidden!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
The missing quote is just a result of me editing for paste here. All sheets are not hidden... there is a "home" sheet the appears upon opening. This code works fine with all 2007 Excel versions, just not 2003.
 


With cut 'n' paste, it's HARD to post something different than is in your code.

Please be absolutely certain that your postings are correct and your information accurately and completely describes the pertinent issue.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Ummm..ok. This has to do with not working in Excel 2003 and producing a Microsoft crash report each time it opens. Perhaps I am posting in the wrong forum.
 


Have you performed a Detect & Repair in Excel 2003?

Have you gone to the Microsoft site to search in the Knowledgebase for something regarding this issue?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
All Office 2003 clients are experiencing this, not just one. No on the Detect & Repair... yes on the MS site search. Thanks for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top