#1
|
|||
|
|||
Macro no longer works
Can anyone help me get a macro that was previously working fine to work again. It is update all fields and is saved in Normal.dot as far as I can tell. Has worked fine on invoices that we make up to do the totals on them. And worked fine until a week ago it just doesnt seem to do anything now. Can anybody help me diagnose whats blocking it. I have already turned off antivirus made no difference. And ALL macros are enabled in word settings.
Code:
Sub UpdateAllFields() ActiveDocument.Fields.Update End Sub Thanks Last edited by macropod; 03-08-2021 at 05:19 PM. Reason: Added code tags |
#2
|
||||
|
||||
The macro is hitting the body of the document and may be missing floating text boxes and header/footers for instance. Also, if your fields are locked or protected by 'restricted editing' then it is possible this is causing your issue.
You may need to post a sample document so we can see what you have going on in your document. Have you changed Word versions since you last saw the macro working? Are you sure the macro is actually running? If you add a msgBox line in the code you can get feedback to know the code is being executed. Code:
Sub UpdateAllFields() MsgBox "Running the UpdateAllFields macro" ActiveDocument.Fields.Update End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Thanks I edited macro to yours and yeh message pops up so macro is running but not updating fields. These are used for invoices for past 8 tears or so have worked fine every month until last week. Running Office Pro 2016 not changed that and win 10pro which obviously updates. If i turn off restricted editing macro blanks all fields which isnt helpful. it used to work fine with it on. Each month would just edit dates and number of runs in invoice hit macro button to update totals then save as pdf. so no idea whats changed but something has.
|
#4
|
|||
|
|||
How do i send you a copy of the doc i cant see any email link ?
|
#5
|
||||
|
||||
You can click on the Go Advanced button when authoring your message and the advanced editor has a attachment paperclip button you use to attach a file.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#6
|
|||
|
|||
Here is a copy of the file.
|
#7
|
||||
|
||||
The macro no longer works, because there is no macro in the document, however you don't need a macro, you need to check 'calculate on exit' to each of the fields in column 4 and then the calculation takes place (see attached).
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#8
|
|||
|
|||
Thanks ! that seems to work fine and is a simpler solution.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Resizing of Outlook Screen No Longer Works | abraxis | Outlook | 0 | 07-06-2018 05:38 AM |
VBA add-in no longer works in Word 2016 - macro error | paulkaye | Word VBA | 6 | 06-13-2017 06:50 AM |
Help with a formula which no longer works. | Silkwood | Excel | 2 | 03-21-2017 02:25 PM |
2007 office key no longer works | millertime | Office | 6 | 02-19-2012 07:50 PM |
Ctrl+Home no longer works to get me to beginning of doc. | migdaw01 | Word | 0 | 01-13-2011 12:11 PM |