View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default veryhidden with xl2000 & xl2003

Is the workbook actually named "Login (1.0)"? Did you remove the XLS
extension? If not try

With Workbooks("Login (1.0).xls").Sheets("Mileage Info")

--
Jim
"JNW" wrote in message
...
| In our office we have machines running both xl2000 and xl2003. The
machine I
| work on is 2000 and I have programmed some macros to make sheets very
hidden.
| Other macros reference these sheets and do calculations without having to
| unhide them.
|
| However, when running the application on xl2003, the sheets are hidden
| properly, but when the calculating macros try to reference them error 9
| occurs (out of range).
|
| Any ideas as to why?
|
| code (the following is just one of the places in the code that gets hung
up.
| I've got a lot of macros that are stopping because of this)
| -----------------------------------------------------------
| Private Sub ButtonGetMiles_Click()
| Application.ScreenUpdating = False
| Dim ChartRange As Object
| Dim Loc1 As Object
| Dim Loc2 As Object
| Dim DistanceMiles As Variant
| Dim DistanceKm As Variant
| Dim TravelTime As Variant
|
| ***the code stops with the following line \/ \/ \/ *****
| With Workbooks("Login (1.0)").Sheets("Mileage Info")
| Set ChartRange = .Range("B2:FT176")
| Set Loc1 = .Range("A201")
| Set Loc2 = .Range("A204")
| End With
|
| DistanceMiles = Application.WorksheetFunction.Index(ChartRange, Loc1,
| Loc2)
| DistanceKm = DistanceMiles * 5 / 3
| TravelTime = DistanceMiles / 60
|
| If ComboLoc1.Value = "" Then
| MsgBox "Please select a starting location."
| ComboLoc1.SetFocus
| Exit Sub
| End If
|
| If ComboLoc2.Value = "" Then
| MsgBox "Please select a destination."
| ComboLoc2.SetFocus
| Exit Sub
| End If
|
| If ComboLoc1.Value = ComboLoc2.Value Then
| MsgBox "Please choose two different destinations."
| ComboLoc1.SetFocus
| Exit Sub
| End If
|
| BoxMiles.Value = DistanceMiles
| BoxKm.Value = DistanceKm
| BoxTravelTime.Value = TravelTime
| Application.ScreenUpdating = True
| End Sub
|