Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unhiding a sheet

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
-------------------------------------------------------------




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Unhiding a sheet

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
----------------------------------------------------------

---




.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unhiding a sheet

Is it the sheet or the workbook that is hidden?

if the sheet, make sure you make the sheet visible before you save the
workbook. (in your code)

If it is the workbook, make sure you make the workbook visible before you
save it. (in your code)

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in 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
-------------------------------------------------------------






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unhiding a sheet

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
----------------------------------------------------------

---




.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unhiding a sheet

Thanks tom,
Yes it is the workbook which is hidden,
but I cannot find any workbook property to unhide it.

see code below





"Tom Ogilvy" wrote in message
...
Is it the sheet or the workbook that is hidden?

if the sheet, make sure you make the sheet visible before you save the
workbook. (in your code)

If it is the workbook, make sure you make the workbook visible before you
save it. (in your code)

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in 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
-------------------------------------------------------------










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unhiding a sheet

There is no macro code running, or associated with the file.

"Newbie" wrote in message
...
check the worksheet_open and worksheet_beforeclose for code that will set

visible back to false.

"Gerry Abbott" wrote:

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
-------------------------------------------------------------







  #7   Report Post  
Posted to microsoft.public.excel.programming
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
----------------------------------------------------------

---




.




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unhiding a sheet

workbooks.visible = True

However, when you open the workbook with automation, it is the application
which is hidden.

xlApp.visible = True
xlapp.Workbooks(1).Visible = True ' just to be sure

now save the worbkook.

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in message
...
Thanks tom,
Yes it is the workbook which is hidden,
but I cannot find any workbook property to unhide it.

see code below





"Tom Ogilvy" wrote in message
...
Is it the sheet or the workbook that is hidden?

if the sheet, make sure you make the sheet visible before you save the
workbook. (in your code)

If it is the workbook, make sure you make the workbook visible before

you
save it. (in your code)

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in 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
-------------------------------------------------------------










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unhiding a sheet

Disregard the sample code (too many errors). See these articles.

http://support.microsoft.com/default...32&Product=xlw
XL97: Workbook Created via Automation Opens as Hidden

http://support.microsoft.com/default...63&Product=xlw
XL2000: Workbook Created with Automation Is Hidden When Opened

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
workbooks.visible = True

However, when you open the workbook with automation, it is the application
which is hidden.

xlApp.visible = True
xlapp.Workbooks(1).Visible = True ' just to be sure

now save the worbkook.

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in message
...
Thanks tom,
Yes it is the workbook which is hidden,
but I cannot find any workbook property to unhide it.

see code below





"Tom Ogilvy" wrote in message
...
Is it the sheet or the workbook that is hidden?

if the sheet, make sure you make the sheet visible before you save the
workbook. (in your code)

If it is the workbook, make sure you make the workbook visible before

you
save it. (in your code)

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in 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
-------------------------------------------------------------












  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Unhiding a sheet

Many thanks Tom,
The KB reference hit the mark.

Would love to know how you found them.

Gerry Abbott


"Tom Ogilvy" wrote in message
...
Disregard the sample code (too many errors). See these articles.

http://support.microsoft.com/default...32&Product=xlw
XL97: Workbook Created via Automation Opens as Hidden

http://support.microsoft.com/default...63&Product=xlw
XL2000: Workbook Created with Automation Is Hidden When Opened

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
workbooks.visible = True

However, when you open the workbook with automation, it is the

application
which is hidden.

xlApp.visible = True
xlapp.Workbooks(1).Visible = True ' just to be sure

now save the worbkook.

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in message
...
Thanks tom,
Yes it is the workbook which is hidden,
but I cannot find any workbook property to unhide it.

see code below





"Tom Ogilvy" wrote in message
...
Is it the sheet or the workbook that is hidden?

if the sheet, make sure you make the sheet visible before you save

the
workbook. (in your code)

If it is the workbook, make sure you make the workbook visible

before
you
save it. (in your code)

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in 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
-------------------------------------------------------------
















  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unhiding a sheet

It was hard, but I knew they were there (having seen them before), so
persistance paid of. I forget the exact search terms I used. Sorry.

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in message
...
Many thanks Tom,
The KB reference hit the mark.

Would love to know how you found them.

Gerry Abbott


"Tom Ogilvy" wrote in message
...
Disregard the sample code (too many errors). See these articles.


http://support.microsoft.com/default...32&Product=xlw
XL97: Workbook Created via Automation Opens as Hidden


http://support.microsoft.com/default...63&Product=xlw
XL2000: Workbook Created with Automation Is Hidden When Opened

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
workbooks.visible = True

However, when you open the workbook with automation, it is the

application
which is hidden.

xlApp.visible = True
xlapp.Workbooks(1).Visible = True ' just to be sure

now save the worbkook.

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in message
...
Thanks tom,
Yes it is the workbook which is hidden,
but I cannot find any workbook property to unhide it.

see code below





"Tom Ogilvy" wrote in message
...
Is it the sheet or the workbook that is hidden?

if the sheet, make sure you make the sheet visible before you save

the
workbook. (in your code)

If it is the workbook, make sure you make the workbook visible

before
you
save it. (in your code)

--
Regards,
Tom Ogilvy

"Gerry Abbott" wrote in 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
-------------------------------------------------------------
















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
Is there a shortcut for unhiding an Excel sheet in a workbook? Colleen Excel Discussion (Misc queries) 2 October 19th 07 11:01 PM
Unhiding a sheet Skint4sure Excel Discussion (Misc queries) 3 December 25th 04 10:27 PM
Click event unhiding sheet Charles Excel Programming 1 July 14th 04 12:58 AM
Preventing someone from unhiding a sheet Neil Excel Programming 4 October 8th 03 01:44 PM
How to Prevent User from Unhiding Sheet Bruce B[_2_] Excel Programming 4 September 17th 03 10:01 AM


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