Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2021, 03:41 PM
Halda Halda is offline Macro no longer works Windows 10 Macro no longer works Office 2016
Novice
Macro no longer works
 
Join Date: Mar 2021
Posts: 5
Halda is on a distinguished road
Default 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
The document is using restricted editing set to filling in forms this has worked fine until now.

Thanks

Last edited by macropod; 03-08-2021 at 05:19 PM. Reason: Added code tags
Reply With Quote
  #2  
Old 03-08-2021, 08:56 PM
Guessed's Avatar
Guessed Guessed is offline Macro no longer works Windows 10 Macro no longer works Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 2,619
Guessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to behold
Default

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
Reply With Quote
  #3  
Old 03-09-2021, 04:46 AM
Halda Halda is offline Macro no longer works Windows 10 Macro no longer works Office 2016
Novice
Macro no longer works
 
Join Date: Mar 2021
Posts: 5
Halda is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 03-09-2021, 04:53 AM
Halda Halda is offline Macro no longer works Windows 10 Macro no longer works Office 2016
Novice
Macro no longer works
 
Join Date: Mar 2021
Posts: 5
Halda is on a distinguished road
Default

How do i send you a copy of the doc i cant see any email link ?
Reply With Quote
  #5  
Old 03-09-2021, 06:51 PM
Guessed's Avatar
Guessed Guessed is offline Macro no longer works Windows 10 Macro no longer works Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 2,619
Guessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to behold
Default

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
Reply With Quote
  #6  
Old 03-09-2021, 06:54 PM
Halda Halda is offline Macro no longer works Windows 10 Macro no longer works Office 2016
Novice
Macro no longer works
 
Join Date: Mar 2021
Posts: 5
Halda is on a distinguished road
Default

Here is a copy of the file.
Attached Files
File Type: docm Not Working macros.docm (22.5 KB, 4 views)
Reply With Quote
  #7  
Old 03-09-2021, 11:08 PM
gmayor's Avatar
gmayor gmayor is offline Macro no longer works Windows 10 Macro no longer works Office 2019
Expert
 
Join Date: Aug 2014
Posts: 3,568
gmayor is a splendid one to beholdgmayor is a splendid one to beholdgmayor is a splendid one to beholdgmayor is a splendid one to beholdgmayor is a splendid one to beholdgmayor is a splendid one to behold
Default

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).
Attached Files
File Type: docm Not Working macros.docm (22.5 KB, 4 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #8  
Old 03-10-2021, 12:31 PM
Halda Halda is offline Macro no longer works Windows 10 Macro no longer works Office 2016
Novice
Macro no longer works
 
Join Date: Mar 2021
Posts: 5
Halda is on a distinguished road
Default

Thanks ! that seems to work fine and is a simpler solution.
Reply With Quote
Reply

Thread Tools
Display Modes


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
Macro no longer works VBA add-in no longer works in Word 2016 - macro error paulkaye Word VBA 6 06-13-2017 06:50 AM
Macro no longer works 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft