Hi,
I created a Publisher trifold at my company in Office 2010 a few years ago. It uses a VBA form to allow my team to easily insert user information into the document.

I certainly wouldn't call myself a pro with VBA but it worked incredibly well in Publisher 2010 and never crashed. Our environment is Windows 7 x64 with a mix of 32 and 64bit Office. After our team updated to Office 2013, the exact same code is causing it to crash when you close the document. Obviously this isn't a huge deal since users are able to open the document, run the macro and save or print it out but it is certainly frustrating.

I have done some troubleshooting and narrowed it down to some kind of issue with the FindReplace function in Publisher. I confirmed this by creating a blank Pub document, inserting just the stock MS example VBA code into it, and saving. It looks like it starts having issues at ActiveDocument.Find.

This is the code:
Sub ExecuteFindReplace()
Dim objFindReplace As FindReplace
Set objFindReplace = ActiveDocument.Find
With objFindReplace
.Clear
.FindText = "library"
.Execute
End With
End Sub



After running the macro and closing the doc the "MS Publisher has stopped working" box appears with the following details:

Problem signature:
Problem Event Name: BEX64
Application Name: MSPUB.EXE
Application Version: 15.0.4569.1503
Application Timestamp: 52b0bf98
Fault Module Name: unknown
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 0000014014e3d000
Exception Code: c0000005
Exception Data: 0000000000000008
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033

Additional information about the problem:
LCID: 1033
skulcid: 1033



Is there something with 2013 VBA in publisher I am doing wrong? Anyone else hit this problem? It doesn't seem to happen if I try the equivalent code in Word, and I have some VBA Word docs that work with no issues.