+ Reply to Thread
Results 1 to 6 of 6

How to insert an image file (eg. jpeg,gif) after protect the worksheet?

  1. #1
    HIV.beta
    Guest

    How to insert an image file (eg. jpeg,gif) after protect the worksheet?

    hi all,
    first, i want to protect(or lock) my worksheet;
    second, i need to insert image file into the protected worksheet.
    third, i just want to know how ?

    help me.


  2. #2
    Dave Peterson
    Guest

    Re: How to insert an image file (eg. jpeg,gif) after protect theworksheet?

    Tools|protection|protect sheet
    allow objects to be changed

    "HIV.beta" wrote:
    >
    > hi all,
    > first, i want to protect(or lock) my worksheet;
    > second, i need to insert image file into the protected worksheet.
    > third, i just want to know how ?
    >
    > help me.


    --

    Dave Peterson

  3. #3
    HIV.beta
    Guest

    Re: How to insert an image file (eg. jpeg,gif) after protect the worksheet?

    "allow objects to be changed" allow you to change the
    status(width,length,color,etc.) of the existing images. but it does not
    allow you to insert a NEW ONE.


  4. #4
    Dave Peterson
    Guest

    Re: How to insert an image file (eg. jpeg,gif) after protect theworksheet?

    Yep. You're correct.

    Unprotect the sheet, add the picture, reprotect the sheet.

    Or set up a macro that does the same thing.

    "HIV.beta" wrote:
    >
    > "allow objects to be changed" allow you to change the
    > status(width,length,color,etc.) of the existing images. but it does not
    > allow you to insert a NEW ONE.


    --

    Dave Peterson

  5. #5
    HIV.beta
    Guest

    Re: How to insert an image file (eg. jpeg,gif) after protect the worksheet?

    Thanx, and how to set up a macro?
    I know little about macro.


  6. #6
    Dave Peterson
    Guest

    Re: How to insert an image file (eg. jpeg,gif) after protect theworksheet?

    A little search of google...

    Option Explicit
    Sub testme02()

    Dim myPictureName As Variant
    Dim myPict As Picture
    Dim myRng As Range

    myPictureName = Application.GetOpenFilename _
    (filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif")

    If myPictureName = False Then
    Exit Sub 'user hit cancel
    End If

    With Worksheets("sheet1")
    .Unprotect Password:="hi"
    Set myRng = .Range("A1:e10")
    Set myPict = .Pictures.Insert(myPictureName)
    myPict.Top = myRng.Top
    myPict.Width = myRng.Width
    myPict.Height = myRng.Height
    myPict.Left = myRng.Left
    myPict.Placement = xlMoveAndSize
    .Protect Password:="hi"
    End With
    End Sub




    "HIV.beta" wrote:
    >
    > Thanx, and how to set up a macro?
    > I know little about macro.


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1