Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-27-2018, 01:00 PM
Stephen Ray Stephen Ray is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 10 After A Reinstall of Office, My Macros Get Multiple Errors Office 2016
Advanced Beginner
After A Reinstall of Office, My Macros Get Multiple Errors
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default After A Reinstall of Office, My Macros Get Multiple Errors

My friends,
I am suddenly getting many errors when I run my Macros. All my Macros used to work very well. I believe it is because my computer got a newer Microsoft Office 2016, but I cannot be certain because I don’t know what version I had before.
But I do know they had to reinstall Microsoft Office on my computer.
So, I had to paste all my Macros back in, I religiously keep backups in several different places. And it was sure a pain to make the Key Assignments again, about 50.
The first thing I thought of is some file that must be installed/clicked/enabled initially to make Macros/VBA work, MSForms?? I have a dim memory of that, but I forgot what it is or how to do it.
Thank you very much for any advice.
I will explain the errors:

Microsoft Visual Basic
Run-time error ‘424’:


Object required
And then, one line is highlighted in yellow:
Clipboard.SetText “John Doe” (only this line is highlighted in yellow)
Clipboard.PutInClipboard

Another Error:
Microsoft Visual Basic for Applications
Compile error:
User-defined type not defined

And then, one line is highlighted in blue:
Dim strTemp As String
Dim myData As DataObject (only this line is highlighted in blue)
Set mydata = New DataObject


Another Error:
Microsoft Visual Baic for Applications
Compile error:
User-defined type not defined

And then, one line is highlighted in blue:
'This part clears the clipboard
Dim clipboard As MSForms.DataObject (only this line is highlighted in blue)
Set clipboard = New MSForms.DataObject
clipboard.SetText ""
clipboard.PutInClipboard
Reply With Quote
  #2  
Old 09-27-2018, 05:22 PM
macropod's Avatar
macropod macropod is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 7 64bit After A Reinstall of Office, My Macros Get Multiple Errors Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Have you set a VBA reference to the MSForms 2.0 Object Library?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-27-2018, 06:27 PM
Stephen Ray Stephen Ray is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 10 After A Reinstall of Office, My Macros Get Multiple Errors Office 2016
Advanced Beginner
After A Reinstall of Office, My Macros Get Multiple Errors
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default

Macropod, Thanks for your reply. I will try that tomorrow morning at the office.
Reply With Quote
  #4  
Old 09-28-2018, 06:44 AM
Stephen Ray Stephen Ray is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 10 After A Reinstall of Office, My Macros Get Multiple Errors Office 2016
Advanced Beginner
After A Reinstall of Office, My Macros Get Multiple Errors
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default

Macropad, It was already set, I did not do it.
Please see attachment

Attached Files
File Type: docx DocAA11.docx (145.0 KB, 8 views)
Reply With Quote
  #5  
Old 09-28-2018, 08:07 AM
Stephen Ray Stephen Ray is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 10 After A Reinstall of Office, My Macros Get Multiple Errors Office 2016
Advanced Beginner
After A Reinstall of Office, My Macros Get Multiple Errors
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default

Perhaps someone can confirm for me that with Microsoft Word 2016, -there has been no change in VBA.
Do all the same old commands still work?
Is all the old syntax still the same?
Any changes I should know about?

If there are no changes in the 2016 version;
I have another theory. I think some settings changed with the Office 2016 Reinstall.
These settings affect whether a space gets appended when pasting from the clipboard.
....Because I noticed that now, some of my pastes get truncated because I must allow for spacing in my Word Document.
To make a long story short, I have to change my VBA code to work with these new default settings, most likely.
....Then maybe the other problems will clear up??? I don't see how.
Reply With Quote
  #6  
Old 09-28-2018, 02:15 PM
macropod's Avatar
macropod macropod is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 7 64bit After A Reinstall of Office, My Macros Get Multiple Errors Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Stephen Ray View Post
Clipboard.SetText “John Doe” (only this line is highlighted in yellow)
Evidently, you've stored this content in a Word document, where your VBA straight quotes have been converted to smart quotes. Change:
Clipboard.SetText “John Doe”
to:
Clipboard.SetText "John Doe"
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 09-28-2018, 06:45 PM
Stephen Ray Stephen Ray is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 10 After A Reinstall of Office, My Macros Get Multiple Errors Office 2016
Advanced Beginner
After A Reinstall of Office, My Macros Get Multiple Errors
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default

Macropad, It took me several readings to see the difference in the quotes. I must go study that.
And in running the Macros, the errors seem to be spontaneously correcting themselves. I have changed only one thing where I took out a backspace before I copied it. I don't see how that could have changed anything else.
I run at least 20 different Macros every day again and again.
It is as if the Macros are magically improving, but I don't believe in magic.
I will keep you informed, I will get back to it on Monday.
Thank you.
Reply With Quote
  #8  
Old 10-01-2018, 06:10 AM
Stephen Ray Stephen Ray is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 10 After A Reinstall of Office, My Macros Get Multiple Errors Office 2016
Advanced Beginner
After A Reinstall of Office, My Macros Get Multiple Errors
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default

MacroPod, Evidently, before the 2016 install, I had set it so spaces were not appended to a paste. The install set things back to the default settings, so I fixed it with:
Microsoft Word, 2016
File, Options, Advanced,
Cut, copy and paste
Uncheck the box – Adjust sentence and Word spacing automatically
Please see attachment for a picture of the above.

It will take me some time to use the Macros to regain confidence that things are fixed. I will keep you informed. And I study your Smart Quotations idea too. Thanks!
Attached Files
File Type: docx Microsoft Word 2016 Cut and Past Options.docx (71.1 KB, 9 views)
Reply With Quote
  #9  
Old 10-03-2018, 11:10 AM
Stephen Ray Stephen Ray is offline After A Reinstall of Office, My Macros Get Multiple Errors Windows 10 After A Reinstall of Office, My Macros Get Multiple Errors Office 2016
Advanced Beginner
After A Reinstall of Office, My Macros Get Multiple Errors
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default

I am still cleaning it up.
I set Microsoft Word 2016 so that it will not append spaces before and after the pasted text, but there are still little differences with the cursor movement. Where I get errors, I trace it back to cursor movement. Sometimes a difference of one space makes a difference when the Macro finds some text, then moves the cursor from the highlighted text, over two spaces instead of three. -For some reason this is the difference from the previous install.

So we are finished here. It was just awful when my Macros weren't working. I thought it was some kind of VBA Syntax change with the new 2016 version.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Office 2010 reinstall not working gossamer Office 0 06-14-2018 01:19 PM
After A Reinstall of Office, My Macros Get Multiple Errors How Many Times Can I Reinstall Microsoft Office Margaret Office 2 05-23-2018 03:41 PM
After A Reinstall of Office, My Macros Get Multiple Errors Reinstall Office 2003 visaar123 Office 1 02-24-2016 03:33 AM
After A Reinstall of Office, My Macros Get Multiple Errors Reinstall Office without a disc TJH Office 1 03-24-2014 08:08 PM
cant reinstall office 2000 Sword Office 0 06-11-2006 02:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:23 AM.


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