我使用此代码非常适合插入图像和调整。我遇到的问题是当你在另一台电脑上打开时,图像丢失,并显示链接缺失。任何人都可以帮我解决这个问题吗?
Sub ChangeImage()
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.ButtonName = "Submit"
.Title = "Select an image file"
.Filters.Clear
.Filters.Add "JPG", "*.JPG"
.Filters.Add "JPEG File Interchange Format", "*.JPEG"
.Filters.Add "Graphics Interchange Format", "*.GIF"
.Filters.Add "Portable Network Graphics", "*.PNG"
.Filters.Add "Tag Image File Format", "*.TIFF"
.Filters.Add "All Pictures", "*.*"
If .Show = -1 Then
Dim img As Object
Set img = ActiveSheet.Pictures.Insert(.SelectedItems(1), LinkToFile = False)
LinkToFile = False
SaveWithDocument = True
'Scale image size
'img.ShapeRange.ScaleWidth .75, msoFalse, msoScaleFromTopLeft
'img.ShapeRange.ScaleHeight .75, msoFalse, msoScaleFromTopLeft
'Position Image
img.Left = 568
img.Top = 63
'Set image sizes in points (71 point per inch)
img.Width = 155
img.Height = 91
Else
MsgBox ("You Forgot Your Image.")
End If
End With
End Sub
答案 0 :(得分:0)
请尝试以下代码:
$('input[name="donate"]').attr('disabled', 'true');
$(document).ready(function () {
$('input[name="satisfied"]').click(function(){
$('input[name="donate"]').removeAttr("disabled");
});});
(并且,正如GSerg在评论中建议的那样,在所有代码模块的开头包含Sub ChangeImage()
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.ButtonName = "Submit"
.Title = "Select an image file"
.Filters.Clear
.Filters.Add "JPG", "*.JPG"
.Filters.Add "JPEG File Interchange Format", "*.JPEG"
.Filters.Add "Graphics Interchange Format", "*.GIF"
.Filters.Add "Portable Network Graphics", "*.PNG"
.Filters.Add "Tag Image File Format", "*.TIFF"
.Filters.Add "All Pictures", "*.*"
If .Show = -1 Then
Application.ActiveSheet.Shapes.AddPicture FileName:=.SelectedItems(1), _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=568, _
Top:=63, _
Width:=155, _
Height:=91
Else
MsgBox ("You Forgot Your Image.")
End If
End With
End Sub
,以确保正确定义您的变量。)