I have zero background in Macros but I need to use it in my new job sometimes. There was a saved file which I just need to run but I always keep getting Run-time error '5152'.
Here's the part where it shows error (red font):
If Sheet3.Cells(ExcelRowCounter, ElementType).Value = "Sub-Process" Then
With ObjWord
.Selection.Font.Name = "Trebuchet MS"
.Selection.Font.Size = 10
.Selection.Range.SetListLevel Level:=5
.Selection.TypeParagraph
Call addimage(urlpathfilename, usedapplicaiton)
.Selection.InlineShapes.AddPicture Filename:=urlpathfilename, LinkToFile:=False, SaveWithDocument:=True
.Selection.Range.SetListLevel Level:=1
.Selection.TypeText Text:=Sheet3.Cells(ExcelRowCounter, 2).Value
.Selection.TypeParagraph
End With
If Sheet3.Cells(ExcelRowCounter, 27).Value <> "" Then
For RomanNumeralCounter = 27 To 46
If Sheet3.Cells(ExcelRowCounter, RomanNumeralCounter).Value <> "" Then
With ObjWord
.Selection.Font.Name = "Trebuchet MS"
.Selection.Font.Size = 10
.Selection.Range.SetListLevel Level:=3
.Selection.TypeText Text:=Sheet3.Cells(ExcelRowCounter, RomanNumeralCounter).Value
.Selection.TypeParagraph
End With
End If
Next RomanNumeralCounter
End If
Any thoughts on what should I do? Help.
Thank you.