Office関連

「2014年12月のWindows Update以降コマンドボタンが使えなくなった」トラブルへのFix it

当ブログでも「KB2553154の更新プログラムをアンインストールするVBScript」記事で取り上げていますが、昨年末に“2014年12月のWindows Update以降コマンドボタンが使えなくなった”というトラブルが数多く報告されました。
(下記はMicrosoft Communityのスレッドの一例です。)

ActiveX コントロールのキャッシュ(exdファイル)が原因のようで、対処法としては、「“オブジェクトを挿入できません” エラーが MS14-082 セキュリティ更新プログラムをインストールした後に ActiveX カスタム Office ソリューションで表示される」にあるように、Windows Updateで該当パッチ(Office 2007:KB2596927、Office 2010:KB2553154、Office 2013:KB2726958)を当てた後、MSForms.exdファイルを削除する、という方法になります。

上記ページではFix itもすでに公開されていて、このFix itを実行すれば自動的にexdファイルを削除してくれるようです。

そこで気になったのがこのFix itの中身。
一体どのような処理をしているのだろう?と気になったので、ファイルを展開して調べてみました。

すると、MSIファイルの中に「Binary.DeleteOfficeFile」ファイルがあり、そのファイル(VBScript)が実際にexdファイルの削除を行っているようでした。

・Binary.DeleteOfficeFile(Microsoft Fix it 51029)

Dim objFso               : Set objFso = CreateObject("Scripting.FileSystemObject")
Dim objShell             : Set objShell = CreateObject("WScript.shell")

Dim officeFolders : officeFolders = Array("%appdata%\microsoft\forms\",_
                               "%temp%\vbe\",_
                                "%temp%\excel8.0\",_
                                "%temp%\word8.0\",_
                                "%temp%\PPT11.0\",_
                                "%temp%\MicrosoftVisio12\",_
                                "%temp%\MicrosoftVisio14\",_
                                "%temp%\MicrosoftVisio15\")

Dim fileExtensionName : fileExtensionName = "EXD"

For Each officeFolder In officeFolders
    If(objFSO.FolderExists(objShell.ExpandEnvironmentStrings(officeFolder))) then
        Set objFolder = objFSO.GetFolder(objShell.ExpandEnvironmentStrings(officeFolder))
        Set colFiles = objFolder.Files
        For Each objFile in colFiles
            If(UCase(objFso.GetExtensionName(objFile.Path)) = fileExtensionName) Then
                objFso.DeleteFile(objFolder.path & "\" & objFile.Name)
            end if	
        Next
    end if
Next

・Binary.DeleteOfficeFile(Microsoft Fix it 51031) ※ 要管理者権限

On Error Resume Next

Const HKEY_LOCAL_MACHINE = &H80000002

Dim objFso               : Set objFso = CreateObject("Scripting.FileSystemObject")
Dim objShell             : Set objShell = CreateObject("WScript.shell")

Dim currentFolderPath
Dim tempFolderPath
Dim appDataFolderPath
Dim fileExtensionName : fileExtensionName = "EXD"

Dim strComputer : strComputer = "."
Dim objRegistry

Dim strKeyPath  : strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
 
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
 
For Each objSubkey In arrSubkeys

    strValueName = "ProfileImagePath"
    strSubPath = strKeyPath & "\" & objSubkey

    objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE,strSubPath,strValueName,strValue
    
    currentFolderPath = strValue

    ' for debug ************************************************
    'Wscript.Echo currentFolderPath 

	If objFSO.FolderExists(objShell.ExpandEnvironmentStrings(currentFolderPath)) Then
		Set currentFolder = objFso.GetFolder(currentFolderPath)

		If objFSO.FolderExists(objShell.ExpandEnvironmentStrings(currentFolderPath & "\AppData\Local\Temp")) or _
		   objFSO.FolderExists(objShell.ExpandEnvironmentStrings(currentFolderPath & "\AppData\Roaming\Microsoft")) Then

			tempFolderPath = objShell.ExpandEnvironmentStrings(currentFolderPath & "\AppData\Local\Temp")
			appDataFolderPath = objShell.ExpandEnvironmentStrings(currentFolderPath & "\AppData\Roaming\Microsoft")

			Dim officeFolders : officeFolders = Array()
			officeFolders = Array(appDataFolderPath & "\forms\", tempFolderPath)                                

			For Each officeFolder In officeFolders
				If(objFSO.FolderExists(objShell.ExpandEnvironmentStrings(officeFolder))) Then
					Set objFolder = objFSO.GetFolder(objShell.ExpandEnvironmentStrings(officeFolder))
					Set colFiles = objFolder.Files
					For Each objFile in colFiles
						If(UCase(objFso.GetExtensionName(objFile.Path)) = fileExtensionName) Then
							
							' for debug ************************************************
							objFso.DeleteFile(objFolder.path & "\" & objFile.Name)
							'Wscript.Echo objFolder.path & "\" & objFile.Name

						End If	
					Next
					ShowSubfolders objFSO.GetFolder(objShell.ExpandEnvironmentStrings(officeFolder))
				End If			
			Next
		End if
	End if


Next


Sub ShowSubFolders(Folder)
On Error Resume Next
    For Each Subfolder in Folder.SubFolders
        Set objFolder = objFSO.GetFolder(Subfolder.Path)
        Set colFiles = objFolder.Files
        For Each objFile in colFiles
		If(UCase(objFso.GetExtensionName(objFile.Path)) = fileExtensionName) Then

			' for debug ************************************************
			objFso.DeleteFile(objFolder.path & "\" & objFile.Name)
			'Wscript.Echo objFolder.path & "\" & objFile.Name

		End If
        Next
        ShowSubFolders Subfolder
    Next
End Sub

なるほど。
コードを見ると、たしかにexdファイルがありそうなフォルダを順番に見て行って、exdファイルがあればそれを削除する、という処理を行っています。

こういった形で未だにVBScriptは使われているのだなー、とちょっと感慨深くなりました。
VBS、未だ死なず。

ただ、今回の一連のトラブルに関しては、

にもあるように、“コマンドボタンの名前が変わってしまう”、といった問題が生じることもあるようです。

2015/02/10 時点では、この問題については「This issue is also being reviewed.」となっているので、対処法はまだ出ていないようですが、何か進展があり次第また追記します。

2015年1月の人気記事前のページ

「Office 2003 のコマンドに対応する Office 2010 のリファレンス ブック」のダウンロード先次のページ

関連記事

  1. Office関連

    右クリックメニューを非表示にするExcelマクロ

    Answersに図形を右クリックしたときのメニューをマクロで非表示にし…

  2. Office アドイン

    [Office用アプリ]野良アプリのススメ

    「Office 用アプリの概要」にもある通り、Office用アプリを公…

  3. Office関連

    文書内の単語を単語ごとにカウントするWordマクロ

    Wordsコレクションを使って文書内の単語を列挙し、各単語がそれぞれい…

  4. Office関連

    Word 2013では簡単にウィンドウ ハンドルを取得できるようになりました。

    ※ この情報はOffice 2013 カスタマー プレビュー版を元にし…

  5. Excel

    Acrobatを使ってPDFファイルをNアップするVBAマクロ

    VBAで、B5サイズのPDFファイルを横並びにしてB4サイズのPDFフ…

コメント

    • Masasumi Nishiura
    • 2015年 3月 10日 1:11am

    お世話になります。にしうらと申します。
    今回のMicrosoft による、WindowsUpdate 絡みで大変苦労しております。(現在も進行形です)
    貴殿がまとめておられる情報は豊富でとてもありがたいです。

    当方。Excel-VBAで中小企業さんや、公立小・中学校の校務支援システムを開発しております。

    使用Excelは、2010です。WindowsUpdateは、最新状態です。
    昨年12月のUpdateを通過した際、自分が開発用に使っている
    Panasonic Let’snote CF-W8/Win7/Office2010 Professional Plus では正常に動作しますが。
    ここで作成したExcel-VBAで組んだシステムをファイルコピーして他のPCで動かそうとすると
    同じ、WIn7/Office2010 Professional Plusでもボタンが効かないものが現れました。

    Msform.exd の削除や、更新ファイルのアンインストールをやってそれで動くものもあればダメなモノもあります。
    実行時エラーの出るPCや、「オブジェクトが無効」と出て削除はできるも新しいボタンなどのオブジェクトが置けなかったり。ActiveXのボタンが置けないかわりに「マクロ」ボタンが置けるのでこのボタンにプログラムを書けば動いたり。あるいは、すんなり動くPCもあり・・・もう何が何か分かりません。

    今だに翻弄されています。どうにかならないですかねぇ~、と情報を求めて右往左往しております。

    また情報がありましたら、教えて下さい。よろしくお願い致します。

      にしうら

    • > Masasumi Nishiura 様

      当ブログ管理人のきぬあさです。

      > 実行時エラーの出るPCや、「オブジェクトが無効」と出て削除はできるも新しいボタンなどのオブジェクトが置けなかったり。ActiveXのボタンが置けないかわりに「マクロ」ボタンが置けるのでこのボタンにプログラムを書けば動いたり。あるいは、すんなり動くPCもあり・・・もう何が何か分かりません。

      「run-time error ‘32809’」( https://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/84762af5-9120-470a-9206-086a83a3813c )によると、

      1.該当パッチ(Office 2007:KB2596927、Office 2010:KB2553154、Office 2013:KB2726958)を一度アンインストールして再起動する。
      2.該当パッチをインストールして再起動する。
      3. http://support2.microsoft.com/kb/3025036/ja にあるFixitを実行して再起動する。

      といった手順で動くようになった方もいるようです。

      ———
      I fixed Runt-time error ‘32809’ appearing on Windows 7 Ent with SP1 x64 with Office 2010 with SP2 32bit with all updates and deleted all *.exd files this way:

      1.uninstall kb2553154, restart
      2.install kb2553154, restart
      3.MicrosoftFixit51029.msi
      4.MicrosoftFixit51031, restart

      My previously working worksheet is working again ;-)
      ———

      今回のUpdate関連のトラブルは環境によって色々な問題が発生しているようで、「これだ!」という解決方法は私の方でも把握できておりません。

      あとは、 http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2014/12/11/forms-controls-stop-working-after-december-2014-updates-.aspx にも記載してある、VBAプロジェクトの再コンパイルを試してみるのも良いかと思います。

      ———
      If the steps above do not resolve your issue, another step that can be tested (see warning below):

      1. On a fully updated machine and after removing the .exd files, open the file in Excel with edit permissions.

      2. Open Visual Basic for Applications > modify the project by adding a comment or edit of some kind to any code module > Debug > Compile VBAProject.

      3. Save and reopen the file. Test for resolution.

      If resolved, provide this updated project to additional users.

      Warning: If this step resolves your issue, be aware that after deploying this updated project to the other users, these users will also need to have the updates applied on their systems and .exd files removed as well.

      If this does not resolve your issue, it may be a different issue and further troubleshooting may be necessary. Please open a support ticket to report the issue.———

  1. この記事へのトラックバックはありません。

Time limit is exhausted. Please reload CAPTCHA.

※本ページはプロモーションが含まれています。

Translate

最近の記事

アーカイブ

PAGE TOP