Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default hiding picture while printing

hi,
i need to hide a picture in excel while printing programatically.

thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default hiding picture while printing

I MEEN IF IT IS POSSIBLE TO MAKE IT UNVISIBLE ON PRINT OUT.

THANKS,

"ermeko" wrote:

hi,
i need to hide a picture in excel while printing programatically.

thanks,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default hiding picture while printing

ermeko:

Add a VBA module to your project and add this code to it.

Sub Pic_Visible()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
shp.Visible = True
End If
Next shp
End Sub

'add this code to Thisworkbook Module
Private Sub Workbook_BeforePrint(Cancel As Boolean)
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
shp.Visible = False
End If
Next shp
Application.OnTime Now + TimeValue("00:00:01"), "Pic_Visible"
End Sub



--

http://www.vba.com.tw/plog/


"ermeko" wrote:

I MEEN IF IT IS POSSIBLE TO MAKE IT UNVISIBLE ON PRINT OUT.

THANKS,

"ermeko" wrote:

hi,
i need to hide a picture in excel while printing programatically.

thanks,

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default hiding picture while printing

THE CODE DID NOTHING.

THE CODE BELLOW IS IN THE VB APPLICATION
objWrk.ActiveSheet.Shapes.AddPicture RESIM, True, True, 160, 340, 350, 350

THIS IS HOW I INSERT THE PICTURE TO THE EXCEL FILE. MAYBE THIS WILL HELP.
AND THERE IS ONLY ONE PICTURE

THANKS,
"chijanzen" wrote:

ermeko:

Add a VBA module to your project and add this code to it.

Sub Pic_Visible()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
shp.Visible = True
End If
Next shp
End Sub

'add this code to Thisworkbook Module
Private Sub Workbook_BeforePrint(Cancel As Boolean)
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
shp.Visible = False
End If
Next shp
Application.OnTime Now + TimeValue("00:00:01"), "Pic_Visible"
End Sub



--

http://www.vba.com.tw/plog/


"ermeko" wrote:

I MEEN IF IT IS POSSIBLE TO MAKE IT UNVISIBLE ON PRINT OUT.

THANKS,

"ermeko" wrote:

hi,
i need to hide a picture in excel while printing programatically.

thanks,

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default hiding picture while printing

You can try this

ActiveSheet.Shapes("Picturename").Visible = False


Or for all pictures

Sub Shapes2()
'Loop through the Shapes collection and use the Type number of the control
Dim myshape As Shape
For Each myshape In ActiveSheet.Shapes

If myshape.Type = 13 Then myshape.Visible = False

Next myshape
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"ermeko" wrote in message ...
THE CODE DID NOTHING.

THE CODE BELLOW IS IN THE VB APPLICATION
objWrk.ActiveSheet.Shapes.AddPicture RESIM, True, True, 160, 340, 350, 350

THIS IS HOW I INSERT THE PICTURE TO THE EXCEL FILE. MAYBE THIS WILL HELP.
AND THERE IS ONLY ONE PICTURE

THANKS,
"chijanzen" wrote:

ermeko:

Add a VBA module to your project and add this code to it.

Sub Pic_Visible()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
shp.Visible = True
End If
Next shp
End Sub

'add this code to Thisworkbook Module
Private Sub Workbook_BeforePrint(Cancel As Boolean)
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
shp.Visible = False
End If
Next shp
Application.OnTime Now + TimeValue("00:00:01"), "Pic_Visible"
End Sub



--

http://www.vba.com.tw/plog/


"ermeko" wrote:

I MEEN IF IT IS POSSIBLE TO MAKE IT UNVISIBLE ON PRINT OUT.

THANKS,

"ermeko" wrote:

hi,
i need to hide a picture in excel while printing programatically.

thanks,





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default hiding picture while printing

Why not just
rightclick on the picture
select format picture
Properties tab
uncheck the Print object box

But this kind of code will toggle that setting:

Option Explicit
Sub testme()
Dim myPict As Picture
With ActiveSheet
Set myPict = .Pictures("Picture 1")
myPict.PrintObject = False
.PrintOut preview:=True
myPict.PrintObject = True
End With
End Sub

ermeko wrote:

hi,
i need to hide a picture in excel while printing programatically.

thanks,


--

Dave Peterson
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
Hiding rows and printing Banker Excel Worksheet Functions 1 April 8th 10 03:51 PM
Hiding Rows when printing pano Excel Worksheet Functions 1 February 23rd 07 01:13 PM
hiding then printing a row S S Excel Worksheet Functions 4 August 9th 06 09:56 PM
Macro for hiding and printing. Olle Svensson Excel Discussion (Misc queries) 5 April 5th 06 04:21 PM
Hiding rows before printing DaveM Excel Discussion (Misc queries) 3 April 16th 05 11:38 AM


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