+ Reply to Thread
Results 1 to 11 of 11

#VBA problem with image,If Use other computer image Not Show"

  1. #1
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Thumbs up #VBA problem with image,If Use other computer image Not Show"

    i have makro in my file when i my computer ,image can show
    but if i use other komputer then my image not show
    please help me
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: #VBA problem with image,If Use other computer image Not Show"

    These appear to be "linked" images - so Excel needs to know where to look for them

    Are the images saved on both computers?
    Are the images in a different folder on second computer?

  3. #3
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: #VBA problem with image,If Use other computer image Not Show"

    only in one komputer ,,in my file not show if use other komputer
    what wrong with my code

    Private Const imgMargin = 2
    Private Const imgStrBegin = "foto"
    Private Const imgExtFilter = "*.jpg;*.jpeg;*.bmp;*.gif;*.png"

    Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    Dim Fd As FileDialog

    If Not LCase(Left(Target(1, 1), 4)) = LCase(imgStrBegin) Then GoTo Canceled
    Set Fd = Application.FileDialog(msoFileDialogOpen)
    With Fd
    .InitialFileName = ThisWorkbook.Path & "\": .Title = "Input Image ..."
    .Filters.Clear: .Filters.Add "Pictures", imgExtFilter
    If .Show <> -1 Then GoTo Canceled
    ActiveSheet.Pictures.Insert(.SelectedItems(1)).Select
    End With
    With Selection.ShapeRange
    .LockAspectRatio = msoFalse
    .Top = Target.Top + imgMargin
    .Left = Target.Left + imgMargin
    .Height = Target.Height - imgMargin * 2
    .Width = Target.Width - imgMargin * 2
    End With
    Canceled:
    Cancel = True: Exit Sub
    End Sub
    Last edited by daboho; 12-13-2016 at 03:05 PM.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: #VBA problem with image,If Use other computer image Not Show"

    Please go back into your previous post and select the relevant the VBA text and click on the # icon. This puts the code inside code tags which makes it much easier to read.

    Try this instead of your code.
    If it still works differently on your 2 PC, then the messages may give you a clue

    Please Login or Register  to view this content.

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: #VBA problem with image,If Use other computer image Not Show"

    You should use Shapes.addpicture if you need embedded pictures rather than Pictures.Insert
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  6. #6
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: #VBA problem with image,If Use other computer image Not Show"

    kev still embed if open in my laptop
    Screenshot_1.png

  7. #7
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: #VBA problem with image,If Use other computer image Not Show"

    xlnitwit : give me coding use shapes input image in merge cell please help me

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: #VBA problem with image,If Use other computer image Not Show"

    @daboho are you running Excel 2013 on both computers?

  9. #9
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: #VBA problem with image,If Use other computer image Not Show"

    By way of example
    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: #VBA problem with image,If Use other computer image Not Show"

    xlnitwit please complet coding thankyou

  11. #11
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: #VBA problem with image,If Use other computer image Not Show"

    That is the complete coding to replace this part
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Please Help! Trying to take an image URL and have the image show up in Excel
    By jkfoxworth in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-20-2015, 07:01 PM
  2. Problem with image File Link in Cell not opening image for preview
    By Orada in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2015, 09:33 AM
  3. Excel 2010 "vlookup pictures vba" links image instead of saving it as an image
    By neverdom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2013, 04:17 AM
  4. Replies: 2
    Last Post: 07-17-2013, 12:12 PM
  5. Extract and display image URL from "Linked image cannot be displayed" pictures
    By apyken in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2013, 09:52 PM
  6. Replies: 2
    Last Post: 05-12-2013, 09:51 PM
  7. [SOLVED] Automatically adding image extension ".jpg" to end of image name
    By Alain in forum Excel General
    Replies: 1
    Last Post: 08-03-2006, 08:00 AM

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