Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Hide shapes (buttons) before printing

So I now have shapes that acts as buttons on my worksheet thanks to help I
got from this group.

Now I want to hide those shapes before I print out the report. So I plan to
add a macro, called from yet another button, to do a print preview.

I'd like to hide those buttons before I do the print preview and then unhide
them at the end of that macro.

From what I am begining to understand about the Exel object model, I suspect
there is a collection of shapes on the workseeht and that each shape in that
collection has a 'visible' property. Since all od the shaps on this
worksheet are button, I will want to hide all of them. And, I may even get
button happy and add more shapes.

So my question is:

How do I hide/unhide all the shapes on a worksheet?

Thanks,
Ken Loomis


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Hide shapes (buttons) before printing

Won't the PrintObject property of the button do? Set it to
False. An educated guess.
Geof.
-----Original Message-----
So I now have shapes that acts as buttons on my worksheet

thanks to help I
got from this group.

Now I want to hide those shapes before I print out the

report. So I plan to
add a macro, called from yet another button, to do a

print preview.

I'd like to hide those buttons before I do the print

preview and then unhide
them at the end of that macro.

From what I am begining to understand about the Exel

object model, I suspect
there is a collection of shapes on the workseeht and that

each shape in that
collection has a 'visible' property. Since all od the

shaps on this
worksheet are button, I will want to hide all of them.

And, I may even get
button happy and add more shapes.

So my question is:

How do I hide/unhide all the shapes on a worksheet?

Thanks,
Ken Loomis


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Hide shapes (buttons) before printing

I discovered that after I posted. And yes, I can set that manually from the
worksheet using the Format Autoshape & Properties tab.

That is neat beacuse it always shows the shapes but never prints them.

Thanks for the help.

"Geof Wyght" wrote in message
...
Won't the PrintObject property of the button do? Set it to
False. An educated guess.
Geof.
-----Original Message-----
So I now have shapes that acts as buttons on my worksheet

thanks to help I
got from this group.

Now I want to hide those shapes before I print out the

report. So I plan to
add a macro, called from yet another button, to do a

print preview.

I'd like to hide those buttons before I do the print

preview and then unhide
them at the end of that macro.

From what I am begining to understand about the Exel

object model, I suspect
there is a collection of shapes on the workseeht and that

each shape in that
collection has a 'visible' property. Since all od the

shaps on this
worksheet are button, I will want to hide all of them.

And, I may even get
button happy and add more shapes.

So my question is:

How do I hide/unhide all the shapes on a worksheet?

Thanks,
Ken Loomis


.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide shapes (buttons) before printing


You pretty much have it already. Here's the code:

Sub test()
Dim s As Shape
For Each s In ActiveSheet.Shapes
s.Visible = msoFalse
Next
End Sub

Use msoTrue to set them back to visible.



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26695

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Hide shapes (buttons) before printing

Thanks. That works great.

Ken Loomis


"kkknie" wrote in message
...

You pretty much have it already. Here's the code:

Sub test()
Dim s As Shape
For Each s In ActiveSheet.Shapes
s.Visible = msoFalse
Next
End Sub

Use msoTrue to set them back to visible.

K


--
kkknie
------------------------------------------------------------------------
kkknie's Profile:
http://www.excelforum.com/member.php...fo&userid=7543
View this thread: http://www.excelforum.com/showthread...hreadid=266952





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hide shapes (buttons) before printing

To expand on Geof's suggestion, right click on the shape and select Format
AutoShape. Go the properties tab and unselect Print Object.

Or you can run this one time

Sub Tester2()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
On Error Resume Next
shp.ControlFormat.PrintObject = False
On Error GoTo 0
Next
End Sub


--
Regards,
Tom Ogilvy

"Ken Loomis" wrote in message
...
So I now have shapes that acts as buttons on my worksheet thanks to help I
got from this group.

Now I want to hide those shapes before I print out the report. So I plan

to
add a macro, called from yet another button, to do a print preview.

I'd like to hide those buttons before I do the print preview and then

unhide
them at the end of that macro.

From what I am begining to understand about the Exel object model, I

suspect
there is a collection of shapes on the workseeht and that each shape in

that
collection has a 'visible' property. Since all od the shaps on this
worksheet are button, I will want to hide all of them. And, I may even get
button happy and add more shapes.

So my question is:

How do I hide/unhide all the shapes on a worksheet?

Thanks,
Ken Loomis




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Hide shapes (buttons) before printing

Thanks, Tom.

That sub will help since I am still adding buttons to this worksheet and
won't need to individually set that as I go. Just run it at the end when I
am done.

Ken Loomis

"Tom Ogilvy" wrote in message
...
To expand on Geof's suggestion, right click on the shape and select Format
AutoShape. Go the properties tab and unselect Print Object.

Or you can run this one time

Sub Tester2()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
On Error Resume Next
shp.ControlFormat.PrintObject = False
On Error GoTo 0
Next
End Sub


--
Regards,
Tom Ogilvy

"Ken Loomis" wrote in message
...
So I now have shapes that acts as buttons on my worksheet thanks to help
I
got from this group.

Now I want to hide those shapes before I print out the report. So I plan

to
add a macro, called from yet another button, to do a print preview.

I'd like to hide those buttons before I do the print preview and then

unhide
them at the end of that macro.

From what I am begining to understand about the Exel object model, I

suspect
there is a collection of shapes on the workseeht and that each shape in

that
collection has a 'visible' property. Since all od the shaps on this
worksheet are button, I will want to hide all of them. And, I may even
get
button happy and add more shapes.

So my question is:

How do I hide/unhide all the shapes on a worksheet?

Thanks,
Ken Loomis






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
drawing shapes move when printing Barry_in_Oz Charts and Charting in Excel 2 October 5th 10 04:57 AM
Shapes not printing in Excel 07 Roberta Excel Discussion (Misc queries) 1 December 18th 09 12:46 AM
Issue printing shapes in Excel 2007 [email protected] Excel Discussion (Misc queries) 1 June 25th 09 03:58 PM
Anchoring shapes when printing in Excel 2007 DLF Excel Discussion (Misc queries) 2 January 2nd 07 05:14 PM
pivot chart is it possible to hide individual field buttons? Layout Field buttons Matt Charts and Charting in Excel 0 August 27th 06 02:57 PM


All times are GMT +1. The time now is 03:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"