Thursday, March 24, 2011

How to make Office 2003 Macro works in Office 2010

So you upgrade to office 2010? Enjoy the great interface? But suddenly, you find your Word Macro that were created on Word 2003/2007 doesn’t work anymore, you get some errors like this: “Compile error: Can’t find project or library”



Basically, it happens because you are missing some OCX file, typically, they are MSCAL.OCX (Microsoft's ActiveX Calendar Control) and mscomct2.ocx(Microsoft Windows Common Controls). Follow below steps, most of your word and excel macro should work:
1. Get the OCX files: you can get mscomct2.ocx from Microsoft website: http://activex.microsoft.com/controls/vb6/mscomct2.cab or http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=25437d98-51d0-41c1-bb14-64662f5f62fe, but not MSCAL.OCX. Of course you can download from other sources, but I would recommend you install office 2003 pro in a spare computer or a VM, then copy this file.

2. Copy these 2 OCX files to c:\windows\system32 (if your OS is 32 bit) or C:\Windows\SysWOW64\ (if your OS is 64 bit).

3. Register these 2 OCX files:
For 32 bit OS:
regsvr32 /s C:\Windows\ system32 \mscomct2.ocx
regsvr32 /s C:\Windows\ system32 \MSCAL.OCX

For 64 bit OS:
regsvr32 /s C:\Windows\SysWOW64\mscomct2.ocx
regsvr32 /s C:\Windows\SysWOW64\MSCAL.OCX

4. Put your file location into trust location:
1). For Word 2010:Click menu “File”-> “Options” -> Trust Center, click "Trust Center settings" button, select "Trusted Locations"; click "Add new location..." button, add your file location there, you may also select "Subfolders of this location are also trusted".

2). Same as Excel 2010

 5. Ok, open your Word/Excel macro file, works? No? oh, you are using office 2010 64 bit, unfortunately, Microsoft said they won’t provide 64bit version of mscomct2.ocx even its name is “Common Controls”.


If your word/excel macro files are shared with other users, you need to implement this change silently to other computers. Here is what I’ve done:

1. Create a folder that includes these file: MSCAL.ocx, mscomct2.ocx, a .bat file, a .reg file:

2. The .reg file (Change “C:\\test\\” to your actual folder):

Windows Registry Editor Version 5.00

 [HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Security\Trusted Locations]

 "AllowNetworkLocations"=dword:00000001

 [HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location9]

 "Path"="C:\\test\\"

 "AllowSubfolders"=dword:00000001

 "Description"=""

 "Date"="2/8/2011 11:19 AM"

  
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Security\Trusted Locations]

 "AllowNetworkLocations"=dword:00000001

 [HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Security\Trusted Locations\Location9]

 "Path"="C:\\test\\"

 "AllowSubfolders"=dword:00000001

 "Description"=""

 "Date"="2/8/2011 12:36 AM"



3. The .bat file(change SysWOW64 to system32 if you are using 32bit OS):

regedit.exe /s .\TrustP.reg
copy .\mscomct2.ocx C:\Windows\SysWOW64\ /Y
regsvr32 /s C:\Windows\SysWOW64\mscomct2.ocx
copy .\MSCAL.OCX C:\Windows\SysWOW64\ /Y
regsvr32 /s C:\Windows\SysWOW64\MSCAL.OCX


Now you can push the change using your patch system like SCCM.



Tuesday, March 15, 2011

FEP(Forefront Endpoint Protection) Excluded Processes for servers

------ Domain Controller -----------------


%systemroot%\System32\ntfrs.exe
%systemroot%\System32\dfsr.exe
%systemroot%\System32\dfsrs.exe


---- DNS Server -----------

%systemroot%\System32\dns.exe


----- Exchange 2007-2010 -------------

EdgeTransport.exe
Microsoft.Exchange.AddressBook.Service.exe
Microsoft.Exchange.Cluster.ReplayService.exe
Microsoft.Exchange.Monitoring.exe
Microsoft.Exchange.RpcClientAccess.Service.exe
Microsoft.Exchange.Search.ExSearch.exe
MSExchangeMailboxReplication.exe
MSExchangeMailSubmission.exe
MSExchangeRepl.exe
MSExchangeTransportLogSearch.exe
MSFTEFD.exe
msftesql.exe
Store.exe
MSExchangeFDS.exe


-- FPE (Forefront Protection for Exchange) --------

FSCConfigurationServer.exe
FSCEventing.exe
GetEngineFiles.exe
ScanEngineTest.exe
FSCManualScanner.exe
FSCScheduledScanner.exe
FSCRealtimeScanner.exe
MultiEngineScanner.exe
Kavehost.exe
FSEMailPickup.exe
FSCVSSWriter.exe

-- Hyper-V Host Server ---------

%systemroot%\System32\vmms.exe
%systemroot%\System32\vmwp.exe
%systemroot%\System32\vds.exe

-- IIS --------------

%systemroot%\system32\inetsrv\w3wp.exe
%systemroot%\SysWOW64\inetsrv\w3wp.exe

-------------- Operations Manager 2007 --------------------

%programfiles%\System Center Operations Manager 2007\HealthService.exe
%programfiles%\System Center Operations Manager 2007\Microsoft.Mom.ConfigServiceHost.exe
%programfiles%\System Center Operations Manager 2007\MonitoringHost.exe

---------- FPSP (Forefront Protection 2010 for SharePoint) ------------------------

FSCConfigurationServer.exe
FSCEventing.exe
GetEngineFiles.exe
ScanEngineTest.exe
FSCManualScanner.exe
FSCScheduledScanner.exe
FSCRealtimeScanner.exe
MultiEngineScanner.exe
Kavehost.exe
FSEMailPickup.exe
FSCVSSWriter.exe
wsstracing.exe
owstimer.exe
mssearch.exe


---- SQL Server 2005 (KB article 309422)--------- --

%ProgramFiles%\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\SQLServr.exe
%ProgramFiles%\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\Bin\ReportingServicesService.exe

%ProgramFiles%\Microsoft SQL Server\MSSQL.2\OLAP\Bin\MSMDSrv.exe


----- SQL Server 2008 (KB article 309422)---------------------

%ProgramFiles%\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\SQLServr.exe

%ProgramFiles%\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\Bin\ReportingServicesService.exe

%ProgramFiles%\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Bin\MSMDSrv.exe

FEP(Forefront Endpoint Protection) File exclusions for Servers

----FEP Default Server Policy--------------

%ALLUSERSPROFILE%\NTuser.pol
%SystemRoot%\System32\GroupPolicy\registry.pol
%windir%\Security\Database\*.chk
%windir%\Security\Database\*.edb
%windir%\Security\Database\*.jrs
%windir%\Security\Database\*.log
%windir%\Security\Database\*.sdb
%windir%\SoftwareDistribution\Datastore\Datastore.edb
%windir%\SoftwareDistribution\Datastore\Logs\edb*.log
%windir%\SoftwareDistribution\Datastore\Logs\Edb.chk
%windir%\SoftwareDistribution\Datastore\Logs\Edbres00001.jrs
%windir%\SoftwareDistribution\Datastore\Logs\Edbres00002.jrs
%windir%\SoftwareDistribution\Datastore\Logs\Res*.jrs
%windir%\SoftwareDistribution\Datastore\Logs\Res*.log
%windir%\SoftwareDistribution\Datastore\Logs\Tmp.edb


---FEP Configuration Manager 2007------------

%programfiles%\Microsoft Configuration Manager\Inboxes\adsrv.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\adsrv.box
%programfiles%\Microsoft Configuration Manager\Inboxes\AIKbMgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\AIKbMgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\amtproxymgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\amtproxymgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\asstdata.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\asstdata.box
%programfiles%\Microsoft Configuration Manager\Inboxes\ccr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\ccr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\ccrretry.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\ccrretry.box
%programfiles%\Microsoft Configuration Manager\Inboxes\certmgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\certmgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\clifiles.src
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\clifiles.src
%programfiles%\Microsoft Configuration Manager\Inboxes\COLLEVAL.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\COLLEVAL.box
%programfiles%\Microsoft Configuration Manager\Inboxes\coll_out.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\coll_out.box
%programfiles%\Microsoft Configuration Manager\Inboxes\CompSumm.Box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\CompSumm.Box
%programfiles%\Microsoft Configuration Manager\Inboxes\coursend.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\coursend.box
%programfiles%\Microsoft Configuration Manager\Inboxes\dataldr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\dataldr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\ddm.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\ddm.box
%programfiles%\Microsoft Configuration Manager\Inboxes\ddmnotif.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\ddmnotif.box
%programfiles%\Microsoft Configuration Manager\Inboxes\distmgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\distmgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\dseval.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\dseval.box
%programfiles%\Microsoft Configuration Manager\Inboxes\hman.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\hman.box
%programfiles%\Microsoft Configuration Manager\Inboxes\inventry.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\inventry.box
%programfiles%\Microsoft Configuration Manager\Inboxes\invproc.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\invproc.box
%programfiles%\Microsoft Configuration Manager\Inboxes\mmctrl.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\mmctrl.box
%programfiles%\Microsoft Configuration Manager\Inboxes\objmgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\objmgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\offermgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\offermgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\OfferSum.Box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\OfferSum.Box
%programfiles%\Microsoft Configuration Manager\Inboxes\pkginfo.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\pkginfo.box
%programfiles%\Microsoft Configuration Manager\Inboxes\PkgTransferMgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\PkgTransferMgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\policypv.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\policypv.box
%programfiles%\Microsoft Configuration Manager\Inboxes\polreq.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\polreq.box
%programfiles%\Microsoft Configuration Manager\Inboxes\rcm.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\rcm.box
%programfiles%\Microsoft Configuration Manager\Inboxes\replmgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\replmgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\RuleEngine.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\RuleEngine.box
%programfiles%\Microsoft Configuration Manager\Inboxes\schedule.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\schedule.box
%programfiles%\Microsoft Configuration Manager\Inboxes\sinv.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\sinv.box
%programfiles%\Microsoft Configuration Manager\Inboxes\sitecomp.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\sitecomp.box
%programfiles%\Microsoft Configuration Manager\Inboxes\sitectrl.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\sitectrl.box
%programfiles%\Microsoft Configuration Manager\Inboxes\SiteStat.Box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\SiteStat.Box
%programfiles%\Microsoft Configuration Manager\Inboxes\smsbkup.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\smsbkup.box
%programfiles%\Microsoft Configuration Manager\Inboxes\statmgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\statmgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\swmproc.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\swmproc.box
%programfiles%\Microsoft Configuration Manager\Inboxes\WSUSMgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\WSUSMgr.box
%programfiles%\Microsoft Configuration Manager\Inboxes\wsyncmgr.box
%programfiles(x86)%\Microsoft Configuration Manager\Inboxes\wsyncmgr.box


------FEP Domain Controller -----------------

%systemroot%\ntds\ntds.dit
%systemroot%\ntds\EDB*.log
%systemroot%\ntds\Edbres*.jrs
%systemroot%\ntds\EDB.chk
%systemroot%\ntds\TEMP.edb
%systemroot%\ntds\*.pat
%systemroot%\SYSVOL\domain\DO_NOT_REMOVE_NtFrs_PreInstall_Directory
%systemroot%\SYSVOL\staging
%systemroot%\SYSVOL\staging areas
%systemroot%\SYSVOL\sysvol


-----FEP DHCP Server-----------------

%windir%\System32\DHCP\*.mdb
%windir%\System32\DHCP\*.edb
%windir%\System32\DHCP\*.pat
%windir%\System32\DHCP\*.log
%windir%\System32\DHCP\*.jrs
%windir%\System32\DHCP\*.chk
%windir%\System32\DHCP\backup\*.mdb
%windir%\System32\DHCP\backup\*.log
%windir%\System32\DHCP\backup\*.chk

----FEP DNS Server ----------------

%windir%\System32\DNS\*.dns
%windir%\System32\DNS\*.scc

----- FEP Exchange 2007-2010 -------------

%ExchangeInstallPath%\Mailbox
%ExchangeInstallPath%\GroupMetrics
%ExchangeInstallPath%\TransportRoles\Logs
%ExchangeInstallPath%\Logging
%ExchangeInstallPath%\ExchangeOAB
%ExchangeInstallPath%\Mailbox\MDBTEMP
%SystemDrive%\DAGFileShareWitnesses\*


-------FEP Hyper-V Host Server -------------

%ProgramData%\Microsoft\Windows\Hyper-V
%Public%\Documents\Hyper-V\Virtual Hard Disks
%ProgramFiles%\Hyper-V
%SystemDrive%\ClusterStorage

------------ IIS -------------------------

%systemroot%\System32\LogFiles
%systemroot%\SysWow64\LogFiles


-------------- Operations Manager 2007 --------------------

%programfiles%\System Center Operations Manager 2007\Health Service State\*


----------------FEP SharePoint 2010 ----------------

%systemroot%\Temp\WebTempDir
%programfiles%\Common Files\Microsoft Shared\Web Server Extensions\14\Logs
%programfiles%\Common Files\Microsoft Shared\Web Server Extensions\12\Logs
%programfiles%\Microsoft Office Servers\14.0\Logs
%programfilesx86%\Microsoft Office Servers\14.0\Logs
%programfiles%\Microsoft Office Servers\12.0\Logs
%programfilesx86%\Microsoft Office Servers\12.0\Logs
%programfiles%\Microsoft Office Servers\14.0\Data
%programfilesx86%\Microsoft Office Servers\14.0\Data
%programfiles%\Microsoft Office Servers\12.0\Data
%programfilesx86%\Microsoft Office Servers\12.0\Data
%systemroot%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
%systemroot%\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files