Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
hiding picture while printing
hi,
i need to hide a picture in excel while printing programatically. thanks, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding rows and printing | Excel Worksheet Functions | |||
Hiding Rows when printing | Excel Worksheet Functions | |||
hiding then printing a row | Excel Worksheet Functions | |||
Macro for hiding and printing. | Excel Discussion (Misc queries) | |||
Hiding rows before printing | Excel Discussion (Misc queries) |