• Hide pasted graphics (2002)

    • This topic has 15 replies, 6 voices, and was last updated 20 years ago.
    Author
    Topic
    #384458

    I’d really like to be able to hide graphics (pasted screen shots) in comments
    so the user has to view the comment to see the screen shot, but you can’t
    paste graphics into comments. Is there a way to hide these graphics so
    the user can click something to reveal the images?

    Viewing 1 reply thread
    Author
    Replies
    • #659645

      Here is a thought (there are other ways)
      Could you put the graphics in a Userform?

      Then have a button on the sheet that puts a particular picture in the userform based on the activecell and shows the form?

      You could also add the comments to the form.

      You could get fancy and ONLY have the button visible/active when the active cell was particular cells (via worksheet selection_change event) or the selection change could SHOW the picture automatically if desired.

      Steve

      • #659677

        Steve,
        The less code in this little project the better. I think I need something
        without userforms — although, as a programmer, I see your gears
        turning and appreciate the feedback…

        • #659742

          You could write code (or get our help) to have them copy the screenshot and then by pushing a button it would paste, resize, place the picture, hide it and do whatever else you wanted. Easy on the user.

          It sounds like you are looking at a 2 step problem:
          1)User has to copy, place, screen shot
          2) then another user will do something to view the screenshots

          Could you give some details of what you would like the code to do and how it would be setup? Both parts could be automated.

          Steve

    • #659660

      Kevin,

      Pictures and Graphics are part of the Shapes collection of a Worksheet. If you have an image called Picture1, then the following code should make it hidden :

      ActiveSheet.Shapes(“Picture1”).Visible = False

      Attached find a sample with a command button to toggle Show/Hide.

      Right click on the Sheet tab and select View Code.

      Andrew

      • #659676

        Andrew,

        That is, of course, very cool. But I’m trying to do this at the
        “user” level. IOW, no code, if possible. The user needs to be able
        to do a Alt-PrintScr, then paste the screen shot into the
        worksheet, then hide the pic.

        Humm. I could put a button on the sheet like you did, and have the
        code behind it set all the pics in, say, column D or whatever go invisible.

        That might work…But the user would have to make sure the pic got
        pasted in column D. Are pics “anchored” in cells or is there a
        “drawing” layer like Word?

        • #659767

          Hi Kevin

          I’d be most interested to know how to place graphics within cells too. My limited understanding was that they belonged to a layer, as you describe it, rather than being able to be “anchored” inside cells. I had a problem a while back, where I wanted the .JPG graphic corresponding to a path/file reference, to be displayed in the cell containing said reference.

          Alan

          • #659790

            Alan,

            Try the following code:

            Range(“g6”).Select
            oPicture =

            • #659849

              Thanks John, and to Steve for the extra information. I’ll certainly give the code a shot. To get specific about the particular project I have in mind, the sheets contain records from a product catalogue with one product per row. One of the columns contains a file reference to a folder that “lives” directly below the .xls. A typical entry might be “pk104.jpg” for product pk104. However, this entry might be the same for the next half a dozen rows – pk104s, pk104t etc. It would therefore be desirable for the graphic to “span” the rows it applies to, but be “attached” to the pk104 cell. Also, all the graphics would appear in the one column, so the column width will be set to the maximum graphic width on that sheet (easy enough).

              The whole thing was derived from a Word doc, where merging cells in a table was used to achieve this “row spanning” effect. At the moment, I have simply used a toolbar button that displays the graphic of the active row in a modal self-sizing popup, but this idea is not conducive to printing the catalogue with graphics, the way it could be done in Word. There are also different issues for onscreen and printed views involving multiline cell entries, but I have addressed (most of) these with appropriate code and commandbar buttons, to produce various “views”.

              Any further suggestions for this configuration most welcome, of course.

              Alan

            • #659854

              Why not just use hyperlinks to open the original source? You could put each link into a cell (it shouldn’t matter if you have the multiple links to the same location).

              Clicking on the link will open the jpeg files with the appropriate associated program.

              Steve

            • #659855

              I toyed with hyperlinks, but users found it distracting jumping to & from IE/Excel. They liked the way the little popups worked though. The real problem I had with this project though, relates to the printable version, rather than the onscreen presentation & navigation. That is, getting the pictures “physically” into cells, with the appropriate cell “spanning”, and the ability to print the whole show properly.

              Alan

            • #659878

              Some thoughts:
              I would think about 2 versions. A “printable” one with all the pictures in the right locations and the “viewable” one. It is tough to have something that meets both well.

              One should be the master if you are going to edit directly onto it and the other should be based on the “master” so when the master is updated the other is also updated.

              Or you just work with the viewable one (with popups) and have a macro to “create the printable” whenever you want to print it.

              I have heard that a “pdf” vesion can still maintain some excel features, though I have never used this.

              Steve

            • #659975

              Interesting thoughts. I’ve thought about lots of alternatives myself during this ongoing project. One was to try to “export” the spreadsheets to a Word doc, where a table structure might provide better formatting options. Another was to use HTML with image tags around the links to the graphics. There are so many issues here, not helped by the client adding to the project all the time, and being blissfully oblivious to the difficulties involved, like why you can’t manage to print 60cm of columns across an A4 page groan

              Certainly the idea of a master is an important one, with “views” derived from only that, via references/links. The printable version, if it ever comes off, would be exactly that, with no need for any “Excel features” save for the rows & columns.

              Thanks for the input, and for anything else you might suggest.

              Alan

            • #660028

              Steve,
              ok, this is now a dev project for me and your code
              will be most helpful. just the kick I need. Thanks.

          • #659800

            If you make the cell wide enough and tall enough to complete enclose the picture, you can format the picture to move and size with the cell and it will stay with the cell thru most operations (you can even sort with it this way)

            This would be equivalent to having a “graphic” as a field in a database.

            It gets more squirrely if the graphic goes across rows and columns. If you insert/delete col or rows the graphic will change size, but moving individual cells does not change the size, but moving an entire region of cells enclosing the picture will move the picture.

            Steve

            • #940289

              So, not exactly timely, but something I learned today and definitely good to know – if you do want to sort and keep the graphics with the originating cells, all the cells in the spreadsheet must be tall enough to hold the tallest cell (i.e.; if you have one cell that needs to be 75 pts. tall to enclose the graphic, you need to make ALL the cells 75 pts. tall) or else you run the risk of having some graphics becoming disassociated with their originating cell text.

    Viewing 1 reply thread
    Reply To: Hide pasted graphics (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: