PDA

View Full Version : Need help getting SaveAs macro to work on hyperlinked document



rborgione
06-03-2014, 08:42 AM
I am working on cleaning up the share drive for my office. With the big picture in mind, I wanted to make sure the new & improved share drive stays neat and tidy. I have taken some of our frequently accessed forms and written macros to save them to a specific file destination and in a specific format. I wanted to make things as simple, cut & dry as possible so even the least computer-savvy person in the office would be able to confidently execute things. Through trial and error, I used the following code (tied to a button on the quick access toolbar) to accomplish my goal:

Sub FirstInitialLastName()
'
' FirstInitialLastName Macro
'
'
docname = InputBox("Enter LastName, FirstName", "docname")
ymd = Month(Now()) & "." & Day(Now()) & "." & Year(Now())
fp = "Z:\Share Drive\Development\Major Gift Officers\FirstName\LOC's\"
fn = docname & " - " & "LOC" & " - " & ymd
ActiveDocument.SaveAs2 FileName:=fp & fn & ".docx"
End Sub

It works great, BUT I'm encountering a problem when I hyperlink this Word doc through a shared Excel workbook. Everything works as it should on my computer, but when other people in the office tested it for me on their computers the file opens, but the macro does not run when the button on the quick access toolbar is clicked. The error (shown below) pops up citing a security issue running the macro. I've had them enable macros in the trust center for both Word & Excel and it's still not working. Thoughts???

11770