Posts

VBA CreateObject() Can’t create ActiveX component on 64Bit Windows

If you are running on a 64bit windows 7 system and have a VBA script that creates a COM/ActiveX/OLE component which fails with an error message like:

 

‘ActiveX component can’t create object’

 

Even though you know the component is registered and that you are using the correct progId etc, then it may be failing because the COM component in question is 32 bit and by default Windows7 runs the 64bit scripting engine.

 

If this is the case then you can get around the problem by explicitly using the 32 bit scripting environment which is most likely located here:

 

C:\Windows\SysWOW64\cscript.exe

 

So to run example.vbs in the 32bit environment use the following:

 

C:\Windows\SysWOW64\cscript.exe example.vbs

 

Hopefully you 32bit component will now load… mine did ;)

 

Winmerge as Git Difftool on 64bit Windows 7

Every software developer’s day to day tasks includes keeping their software development tools up to date and running smoothly, today I got tired of viewing git differences in the raw and decided to hook winmerge up for viewing diffs.

 

Instructions for setting winmerge up as your Git difftool can be found here:

 

http://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-visual-diff-program/949242#949242

 

I tried to apply these instructions on Windows 7 64bit and had to make 2 changes to get it to work.

 

Change this command (run in git bash):

 

[code]
git config –global difftool.winmerge.cmd “winmerge.sh \”$LOCAL\” \”$REMOTE\””
[/code]

 

to this:

 

[code]
git config –global difftool.winmerge.cmd ‘winmerge.sh “$LOCAL” “$REMOTE”‘
[/code]

 

and in winmerge.sh, change this line:

 

[code]
“C:/Program Files/WinMerge/WinMergeU.exe” -e -ub “$1” “$2”
[/code]

 

to:

 

[code]
“C:\Program Files (x86)/WinMerge/WinMergeU.exe” -e -ub “$1” “$2”
[/code]

 

After making these changes differences were shown in winmerge after issuing the difftool command.