PC Review


Reply
Thread Tools Rate Thread

Does this code Delete pictures or simply makes them Invisible

 
 
Corey
Guest
Posts: n/a
 
      9th Aug 2007
In time am i going to have a very large file if many pictures have been used and removed by the
following code?


With Sheets("Procedure")
..Select
..Unprotect
Dim lnCnt As Long, sStr As String
Application.ScreenUpdating = False
For lnCnt = 1 To ActiveSheet.Shapes.Count
With ActiveSheet.Shapes(lnCnt)
sStr = Left(.Name, 1)
If sStr <> "S" Then
If sStr <> "B" Then
.Visible = False ' <== Are they deleted or are they stored with the file still ?
If sStr = "L" Then .Line.ForeColor.SchemeColor = 8
End If

End If
End With
Next


Corey....


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      10th Aug 2007
Corey,

Setting the Visible property to false would make it hidden. It would still
be there.. To delete, use the Delete method.

--
Hope that helps.

Vergel Adriano


"Corey" wrote:

> In time am i going to have a very large file if many pictures have been used and removed by the
> following code?
>
>
> With Sheets("Procedure")
> ..Select
> ..Unprotect
> Dim lnCnt As Long, sStr As String
> Application.ScreenUpdating = False
> For lnCnt = 1 To ActiveSheet.Shapes.Count
> With ActiveSheet.Shapes(lnCnt)
> sStr = Left(.Name, 1)
> If sStr <> "S" Then
> If sStr <> "B" Then
> .Visible = False ' <== Are they deleted or are they stored with the file still ?
> If sStr = "L" Then .Line.ForeColor.SchemeColor = 8
> End If
>
> End If
> End With
> Next
>
>
> Corey....
>
>
>

 
Reply With Quote
 
Corey
Guest
Posts: n/a
 
      10th Aug 2007
Reverted to this:
Dim xlShape As Shape
For Each xlShape In ActiveSheet.Shapes
If xlShape.Type = msoPicture Then xlShape.Delete
Next
As i found the file was gaining in size as the pictures were simply invisible instead of being
deleted.

File dropped in size dramatically when run this the first time.



"Corey" <(E-Mail Removed)> wrote in message news:ep%(E-Mail Removed)...
In time am i going to have a very large file if many pictures have been used and removed by the
following code?


With Sheets("Procedure")
..Select
..Unprotect
Dim lnCnt As Long, sStr As String
Application.ScreenUpdating = False
For lnCnt = 1 To ActiveSheet.Shapes.Count
With ActiveSheet.Shapes(lnCnt)
sStr = Left(.Name, 1)
If sStr <> "S" Then
If sStr <> "B" Then
.Visible = False ' <== Are they deleted or are they stored with the file still ?
If sStr = "L" Then .Line.ForeColor.SchemeColor = 8
End If

End If
End With
Next


Corey....



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying C drive makes destination folder invisible Ronny Windows XP Help 2 2nd Aug 2008 07:02 AM
Delete Unlocked Pictures from Sheet1 with Code Corey Microsoft Excel Programming 2 30th Jul 2007 09:20 AM
Can I simply delete a snap-in? =?Utf-8?B?dHNwcmFndWU=?= Windows XP Security 3 23rd Dec 2004 05:31 AM
Restore window makes it invisible? Cannot resize! Mike Haney Microsoft Outlook Discussion 0 29th Apr 2004 02:04 PM
Running scheduled task under local account makes it invisible. polzovatel Microsoft Windows 2000 Applications 0 30th Mar 2004 08:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:54 PM.