![]() |
#1
|
|||
|
|||
![]()
Friends, Please help me yet once again.
Many of my Macros suddenly stopped working. I lost all my macros but luckily, I had backup copies of all my Macros. And I had to re-do about 50 short-cut keys! I figured out they updated the system to Office 365. So I know it is some setting somewhere. Please see attachment for the error that I copied and pasted. Dim clipboard As MSForms.DataObject Compile Error: User-defined type not defined. It had been working previously. There are many similar errors in other Macros. This is just one example. Thank you in advance for your help. |
#2
|
||||
|
||||
![]()
You are missing a reference. Have a look at this webpage for how to add the reference https://www.excelforum.com/excel-pro...ataobject.html
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
![]()
GUESSED, thanks,
I have FM20.dll It is located at C:\Windows\System32 Is this the right location? My Computer: Windows 10 Enterprise, 64 Bit, Office365 Pro Plus The webpage you suggested said that if all fails, try to explicityly reference the dataobject as being from the Forms library like this: Dim ClipboardISBN as MSForms.dataobject I would hate to do this in 29 places in all my MACROS. But I will try it and we will see what happens. |
#4
|
|||
|
|||
![]()
Well, that did not work, Please see attachment.
And the FM20.dll is an old file from 2015, please see the other attachment. How can I tell if MSFORMS is installed and ok? Could that be the problem? |
#5
|
|||
|
|||
![]()
For future reference, keep backups of your work.
Store your macros and related keyboard shortcuts in a separate Global Template, not in the normal template. |
#6
|
|||
|
|||
![]()
Charles Kenyon, Omigosh! You can save the Keyboard Shortcuts?!? I never heard of anything like that. In this very large building of about 1,300 people, I am the only one who uses Macros.
You'd better believe I am going to figure out how to do that! Thanks for the link. But would I be able to restore all my Keyboard Shortcuts in case of an update to a new version or hard drive failure? It would have to be stored on another computer. They never tell us ahead of time about updates. |
#7
|
||||
|
||||
![]()
Just having the file is not enough. When you browse to it, you have to select it and click OK. Then you check it comes up as ticked in your References list.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#8
|
|||
|
|||
![]()
Guessed, I will work on it this weekend. This is difficult for me. I don't know where to go to "Select" the file, as you said. I foolishly went to File Explorer - C:\Windows\System32\FM20.dll
This is not the right place. |
#9
|
|||
|
|||
![]()
My problem is that some of my macros will not work anymore. They used to work fine. I think they updated to a new version of Word366 and this new Word Version is not quite right yet.
The Macro stops dead in its tracks with this command highlighted in blue: Dim myData As DataObject Also there is a little box with this error inside: Compile error: User-defined type not defined. I have C:\Windows\System32\FM20.dll Windows 10 Enterprise, 64 Bit, Office365 Pro Plus And I don't know where to go or how to register FM20.dll |
#10
|
||||
|
||||
![]()
On a 64 bit Windows system FM20.DLL should be in the folder C:\Windows\SysWOW64.
First move the file to that folder. Next From the Windows start menu, right click Windows Command Prompt and select More > Run as Administrator. A small black window will open with a flashing cursor. At the prompt type regsvr32 "C:\Windows\SysWOW64\FM20.dll" and press the Enter key. You should get confirmation that the file is registered.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#11
|
|||
|
|||
![]()
GMayor, Thank you, I will try it tomorrow morning at work.
|
#12
|
|||
|
|||
![]()
GMayor,
That didn't work, I am sure it is a permissions issue. I will get a tech person here to help me with Administrative Rights. I am convinced the problem is the Registration of FM20.dll -as you say. When I get it registered, I will let you know if all is well or not. In this very large office of 1,300 people nobody else uses MACROS but me. |
#13
|
|||
|
|||
![]()
GMayor,
It registered ok, please find attachment, screen shot of the Command Prompt Window and success window. But I still get the same error. I rebooted too, but the same error appears. |
#14
|
||||
|
||||
![]()
In the VBA Editor while looking at the macro...
Go to Tools > References. This opens the References dialog In the References dialog, find Microsoft Forms 2.0 Object Library and put a tick beside it and press OK If the References dialog doesn't show Microsoft Forms x.x Object Library, click the Browse... button and an Add Reference dialog appears (with the System32 folder open). Find the FM20.dll file and select it and click the Open button. This returns you to the References dialog and you should now see the object library in the list and it will be ticked. Click the OK button to close the References dialog. Go to Debug > Compile Project and you should now see that line in your code is now accepted IF any of the menu commands are greyed out, click the Reset (square) button on the toolbar to stop the macro - when a macro is paused, some of the menu commands are not available.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#15
|
|||
|
|||
![]()
Guessed,
Thank you for your reply, I will take some time with it soon. I am working 12 hour days here, so I don't have a lot of time. Yesterday they said some of us should come in on Sunday too! I am all by myself with MACROs but they have several of us trying to learn PowerShell to use with Active Directory. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
gsrikanth | Excel Programming | 2 | 03-28-2022 06:32 AM |
![]() |
bennyamy | Excel Programming | 4 | 03-23-2017 11:42 AM |
![]() |
OTPM | Project | 3 | 01-02-2014 01:47 PM |
![]() |
tinfanide | Excel Programming | 2 | 06-09-2012 10:19 AM |
![]() |
Manit | Excel Programming | 4 | 12-08-2011 07:35 PM |