![]() |
#1
|
|||
|
|||
![]()
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 |
#2
|
||||
|
||||
![]()
Have you set a VBA reference to the MSForms 2.0 Object Library?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Macropod, Thanks for your reply. I will try that tomorrow morning at the office.
|
#4
|
|||
|
|||
![]()
Macropad, It was already set, I did not do it.
Please see attachment |
#5
|
|||
|
|||
![]()
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. |
#6
|
||||
|
||||
![]() Quote:
Clipboard.SetText “John Doe” to: Clipboard.SetText "John Doe"
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
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. |
#8
|
|||
|
|||
![]()
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! |
#9
|
|||
|
|||
![]()
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. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Office 2010 reinstall not working | gossamer | Office | 0 | 06-14-2018 01:19 PM |
![]() |
Margaret | Office | 2 | 05-23-2018 03:41 PM |
![]() |
visaar123 | Office | 1 | 02-24-2016 03:33 AM |
![]() |
TJH | Office | 1 | 03-24-2014 08:08 PM |
cant reinstall office 2000 | Sword | Office | 0 | 06-11-2006 02:06 AM |