Macro to bring Excel data into Word template
I'm having trouble with the below Macro. This is used to find information in an excel worksheet and use that info to fill in a word template. We used this in the past (2019ish) and it ran just fine, but now I either get a "Run Time Error 5852," or it just crashes Word. I ran the debugger and the bolded line seems to be causing this. I've tried linking the excel file as the MailMerge source, but that didn't work either. I didn't write this and I'm pretty new to macros, so I'm not sure how else to trouble shoot this.
Code:
Sub Outage
Dim dsMain As MailMergeDataSource, Ticker As String
Ticker = InputBox("Enter the Ticker:")
With ActiveDocument.MailMerge.DataSource
Do While .FindRecord(FindText:=Ticker, Field:="Ticker") = True
If .DataFields("Ticker") = Ticker Then
numRecord = .ActiveRecord
Exit Do
End If
Loop
End With
End Sub