0

I have a workbook saved on a network drive with many ActiveX Command Buttons, I have given them all appropriate names and the code blocks for those button names.

Twice now when a coworker of mine has tried to open the book and use the functionality none of the buttons have worked. Investigating lead me to notice that all of the names of the buttons reset back to "CommandButton1" "CommandButton2" etc etc.

No matter how hard I've looked I can't find any clues about what might be causing this. Any help is greatly appreciated.

Both using Excel 2010

Greg Bomba
  • 28
  • 4
  • when was the last time that the buttons were working? are they still working on yuor computer? – user 12321 Feb 09 '15 at 18:22
  • I have a backup of the file saved locally on my machine that i've used to correct this twice. The last time it was working on the network drive location was when it was last used on the 6th. I just corrected the file from the backup and my co-worker was able to use, update, and save the sheet properly. So far command buttons are still good. I am going to be monitoring the file to see if/when the button names revert. – Greg Bomba Feb 09 '15 at 18:24

2 Answers2

0

I guess what's wrong in your coworker system, is the recent Microsoft update which breaks the ActiveX controls. Try this solution, it should fix the issue if this is the case.

1- Close all Office applications.

2- Do a search in Windows Explorer – make sure to include hidden and system files and folders – for *.exd files (note: that’s not *.exe !!) and delete any you find. Make sure you get these: C:\users\username\AppData\Local\Temp\Excel8.0\MSForms.exd C:\users\username\AppData\Local\Temp\VBE\MSForms.exd

3-Reboot the computer (this is not always necessary, but probably better safe than sorry)

4-Restart your Office apps and test the controls again.

Community
  • 1
  • 1
user 12321
  • 2,846
  • 1
  • 24
  • 34
  • Seems like this is the right track. Have not gotten it working yet for the 2 coworkers i've narrowed it down to, but I am still pursuing. Thanks. I'll mark when resolved. – Greg Bomba Feb 09 '15 at 19:06
  • This lead me in the right direction - thank you. I ended up having to remove the KB2553154 update from a few of their computers to get it working. Just the .exd files didnt do it. – Greg Bomba Feb 09 '15 at 19:39
0

I had the same problem a few week ago you can see my question here. No one was able to help me, I tried different ways to fix it. I finally managed to fix it a few days later by following this link

Copy and paste the following VBA code into any module in the spreadsheet.(Module 1 for me)

Public Sub RenameMSFormsFiles() 
    Const tempFileName As String = "MSForms - Copy.exd"  
    Const msFormsFileName As String = "MSForms.exd"  
    On Error Resume Next 

    'Try to rename the C:\Users\[user.name]\AppData\Local\Temp\Excel8.0\MSForms.exd file  
    RenameFile Environ("TEMP") & "\Excel8.0\" & msFormsFileName, Environ("TEMP") & "\Excel8.0\" & tempFileName 
    'Try to rename the C:\Users\[user.name]\AppData\Local\Temp\VBE\MSForms.exd file  
    RenameFile Environ("TEMP") & "\VBE\" & msFormsFileName, Environ("TEMP") & "\VBE\" & tempFileName 
End Sub  

Private Sub RenameFile(fromFilePath As String, toFilePath As String) 
    If CheckFileExist(fromFilePath) Then 
        DeleteFile toFilePath  
        Name fromFilePath As toFilePath  
    End If  
End Sub  

Private Function CheckFileExist(path As String) As Boolean 
    CheckFileExist = (Dir(path) <> "")  
End Function  

Private Sub DeleteFile(path As String) 
    If CheckFileExist(path) Then 
        SetAttr path, vbNormal  
        Kill path  
    End If  
End Sub

Then call the RenameMSFormsFiles subroutine at the very beginning of the Workbook_Open event.

Private Sub Workbook_Open() 
    RenameMSFormsFiles  
End Sub
Community
  • 1
  • 1
phil652
  • 1,484
  • 1
  • 23
  • 48
  • Certainly was the same problem, i've narrowed it down to 2 coworkers who this happens with. One i tried deleting the .exd files in %temp% but it didnt work. Going to try again soon, and maybe remove the update in question from 2014. – Greg Bomba Feb 09 '15 at 19:05
  • Removing the .exd files didnt help. Removing the KB2553154 update fixed it. – Greg Bomba Feb 09 '15 at 19:38
  • The reason why I told you to put this code in your excel vba is because in my office windows updates are controlled by IT so I don't have access to them and I know a lot of office are like that. – phil652 Feb 09 '15 at 19:41