Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-02-2015, 01:03 AM
Catalin.B Catalin.B is offline Mouseover image Windows Vista Mouseover image Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Hi Igorr,
Is there a reason behind this prefference?
You can use a code to load images in comments, and after this is done, you will not depend on macros to view the images, it will work even without macros enabled...

You can try the file attached for another possibility.
I used the LoadImagePath procedure to insert the images from a folder named Images, located in the same folder where this workbook is saved. (the images are already inserted, no need to run the code again, only if you want to change the images)
Code:
Sub LoadImagePath()
Dim Types As String, Nm As String
Types = "JPEG Image, PNG Image" 'add more types if needed
Dim Dest As Worksheet, i As Integer, oFso As Object, Img As Object
Set Dest = Worksheets("Mouse Over")
Set oFso = CreateObject("Scripting.FileSystemObject")
i = 2
For Each Img In oFso.getfolder(ThisWorkbook.Path & "\Images").Files
    If InStr(Types, Img.Type) > 0 Then
            Dest.Cells(i, "A") = Img.Path
            Rows(i).RowHeight = 75
            Nm = Mid(Dest.Cells(i, "A").Text, InStrRev(Dest.Cells(i, "A").Text, "\") + 1, InStr(Dest.Cells(i, "A").Text, ".") - InStrRev(Dest.Cells(i, "A").Text, "\") - 1)
            DoEvents
            Application.Goto Dest.Cells(i, "B")
            Dest.Pictures.Insert(Dest.Cells(i, "A").Text).Select
            Selection.Height = 75
            Selection.Name = Nm
     '      Dest.Cells(i, "E") = Img.Type
            i = i + 1
    End If
Next
End Sub
The ShowHide function below, will react when called from the Hyperlink function used in cells from columns B and C:
Code:
Function ShowHideImage(Rw As Integer, ViewOption As Boolean)
Dim Nm As String
Dim Dest As Worksheet
Set Dest = Worksheets("Mouse Over")
Nm = Mid(Dest.Cells(Rw, "A").Text, InStrRev(Dest.Cells(Rw, "A").Text, "\") + 1, InStr(Dest.Cells(Rw, "A").Text, ".") - InStrRev(Dest.Cells(Rw, "A").Text, "\") - 1)

If ViewOption Then
    Dest.Shapes(Nm).Height = 75
Else
    Dest.Shapes(Nm).Height = 0
End If

End Function
Attached Files
File Type: xlsm Show images on mouseOver.xlsm (20.7 KB, 18 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouseover image Setting up signature image and image is received blurry Beesoy06 Outlook 2 03-23-2015 09:01 PM
Losing image resolution when inserting image into MS word (2011: Mac) Mario.N Drawing and Graphics 0 11-23-2014 02:38 AM
Mouseover cell to indicate mouse pointer location based on Specific Row/Column values bolandk Excel 1 05-15-2014 08:22 AM
Mouseover image Highlight text when mouseover kxt Word 4 05-17-2012 04:21 PM
Mouseover Highlite designer PowerPoint 0 01-19-2011 07:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft