Consulting

Results 1 to 4 of 4

Thread: global arrays are reset after pasting images from another sheet

  1. #1

    global arrays are reset after pasting images from another sheet

    hi,
    i have a few global arrays (declared in a module).
    in Sheet1 i have a few images and i give the arrays some values. i copy one of the images and paste it in another Sheet and the arrays values reset.

    can someone please advice?

    thanks

  2. #2
    I know this happens when you do this with an ActiveX object (from the control toolbox). Are these Image objects from that toolbar? If so, try the same with the insert picture control on the drawing toolbar.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3

    thanks for the answer

    can i create a form button and attach a picture and macro to it using VBA ?
    can i do it to a picture control?

  4. #4
    A forms button cannot have a picture on its face. The other options are simple enough:
    Sub PlaceButton()
        With ActiveSheet.Buttons.Add(ActiveCell.Left, ActiveCell.Top, ActiveCell.Width, ActiveCell.Height)
            .OnAction = "PlaceButton"
            .Caption = "New button"
        End With
    End Sub
    
    'Call this one like this:
    'AddPicture "c:\MyDocuments\MyPic.jpg
     
    Sub AddPicture(sFileName)
        ActiveSheet.Pictures.Insert (sFileName)
    End Sub
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

Posting Permissions

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