marshalxxl
New Member
- Joined
- Nov 17, 2018
- Messages
- 12
Sub PictureInCommentSize()
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False 'Only one file
.InitialFileName = CurDir 'directory to open the window
.Filters.Clear 'Cancel the filter
'.Filters.Add Description:="Images", Extensions:="*.jpg", Position:=1
.Title = "Choose image"
If .Show = -1 Then TheFile = .SelectedItems(1) Else TheFile = 0
End With
'No file selected
If TheFile = 0 Then
MsgBox ("Mai incearca gogule")
Exit Sub
End If
'Make comment
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=""
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Shape.Fill.UserPicture TheFile
ActiveCell.Comment.Shape.ScaleWidth 3, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Shape.ScaleHeight 3, msoFalse, msoScaleFromTopLeft
End Sub
Hello can somebody add in this macro this thing aswell ? : With Selection
.Comment.Shape.SetShapesDefaultProperties
.ClearComments
End With
I want to use both first one works great for inserting the comment and the secound one i need to add so i don`t get the "excel found unreadable content error" because based on xml
i discoverd that my file get`s corrupted everytime when i delete a comment and ithink this will solve the problem (the 2nd macro will solve the problem.
Basically i have no idea how to make them both to work please help
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False 'Only one file
.InitialFileName = CurDir 'directory to open the window
.Filters.Clear 'Cancel the filter
'.Filters.Add Description:="Images", Extensions:="*.jpg", Position:=1
.Title = "Choose image"
If .Show = -1 Then TheFile = .SelectedItems(1) Else TheFile = 0
End With
'No file selected
If TheFile = 0 Then
MsgBox ("Mai incearca gogule")
Exit Sub
End If
'Make comment
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=""
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Shape.Fill.UserPicture TheFile
ActiveCell.Comment.Shape.ScaleWidth 3, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Shape.ScaleHeight 3, msoFalse, msoScaleFromTopLeft
End Sub
Hello can somebody add in this macro this thing aswell ? : With Selection
.Comment.Shape.SetShapesDefaultProperties
.ClearComments
End With
I want to use both first one works great for inserting the comment and the secound one i need to add so i don`t get the "excel found unreadable content error" because based on xml
i discoverd that my file get`s corrupted everytime when i delete a comment and ithink this will solve the problem (the 2nd macro will solve the problem.
Basically i have no idea how to make them both to work please help
Last edited: