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
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
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?
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.
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.
You should use Shapes.addpicture if you need embedded pictures rather than Pictures.Insert
Don
Please remember to mark your thread 'Solved' when appropriate.
kev still embed if open in my laptop
Screenshot_1.png
xlnitwit : give me coding use shapes input image in merge cell please help me
@daboho are you running Excel 2013 on both computers?
By way of example
![]()
Please Login or Register to view this content.
xlnitwit please complet coding thankyou
That is the complete coding to replace this part
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks