PDA

View Full Version : VBA on an old machine



samuelimtech
01-28-2015, 07:22 AM
Hi all,

Ive written some vba on a Windows 7 machine running office 2010, the spreadsheet is then given to somebody else running Windows XP office 2007.
the code hiccups when using the function Right, I imagine if it ever gets past here something else will cause issue.

anyway if I get the person to buy office 2010 will this solve the problem? or will they need to upgrade the OS too?

thanks

Bob Phillips
01-28-2015, 07:32 AM
That sounds as if you have a missing reference, no need to upgrade anything.

samuelimtech
01-28-2015, 08:30 AM
That sounds as if you have a missing reference, no need to upgrade anything.

thats very possible but i thought that enabled references are carried with the excel file?

if its the case that the computer doesnt have the reference at all will upgrading his copy of office fix the issue?

samuelimtech
01-28-2015, 08:31 AM
Also if the reference exists in the library but isnt enabled is there a way to enable it with VBA?
i think the answer to that is going to be a big no no

Aflatoon
01-28-2015, 09:29 AM
The usual scenario is that you have a reference to another Office application library (e.g. Word or Outlook 2010) and that isn't backwards compatible. It could also be something like the Windows Common Controls which not all machines have installed. For the former, you can late bind your code; for the latter, you're better off avoiding the controls, IMO.

samuelimtech
01-28-2015, 09:43 AM
The usual scenario is that you have a reference to another Office application library (e.g. Word or Outlook 2010) and that isn't backwards compatible. It could also be something like the Windows Common Controls which not all machines have installed. For the former, you can late bind your code; for the latter, you're better off avoiding the controls, IMO.

thanks for that, I will Look at late binding and see if that works.