View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Unhiding a sheet

Hi
try replacing
myWb.Worksheets(1).Visible = xlSheetVisible

with
myWb.Worksheets(1).Visible = -1

--
Regards
Frank Kabel
Frankfurt, Germany

"Gerry Abbott" schrieb im Newsbeitrag
...
See below

"Frank Kabel" wrote in message
...
Hio
what is the exact code you have used which does not work
with a hidden sheet)?

-----Original Message-----
Hi all,
Im using some code from another application (access) to

populate a range
with data, and save the sheet. However when I save it and

open it, the sheet
i've worked on is Hidden. I can unhide this manually, and

all else is in
order.

I used the sheet.visible property before saving but this

does not work.

Any advice welcome.


Gerry Abbott


Code:
----------------------------------------------------------

---
Private Sub Command2_Click()

Dim myWb As Workbook
Dim mySh As Worksheet
Dim i As Integer

Set myWb = GetObject("My file........")
Set mySh = myWb.Worksheets("ResCare")

For i = 1 To 10
mySh.Range("A" & i).Value = i * 10
Next i

myWb.Worksheets(1).Visible = xlSheetVisible
myWb.Save

Set mySh = Nothing
Set myWb = Nothing

End Sub
----------------------------------------------------------

---




.