Thread: Version issues
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John Keith[_2_] John Keith[_2_] is offline
external usenet poster
 
Posts: 175
Default Version issues

I knew there was a reason I kept that old DOS machine :)
But thats a good rule to follow, I think I will add it to my bag-of-tricks

I will try recording an opentext on the SP-1 based PC and see what it returns

--
Regards,
John


"Tom Ogilvy" wrote:

As a general rule, you should develop on the oldest version of excel for
which the code will be run. Particularly if you are using the recorder.

If you don't want to do that, go to the oldest version and painstakingly do
what you are doing.

--
Regards,
Tom Ogilvy

"John Keith" wrote in message
...
I am having fits trying to deploy a spreadsheet with VBA.

I have developed the sheet in Excel2002-SP3(loaded from XP Office prof

2003)
on Windows2000 SP4
It works fine on that platform...
it also works on a Win2000 SP2 platform.

On a NT based PC runing Excel2000 this line gives a compile error:
Set fso = CreateObject("Scripting.FileSystemObject")

On win2000 running Excel2002-sp1...
Complie error on the "TrailingMinusNumbers:=True" of the Workbook.OpenText
cmd. Removed that option completely (since its optional anyway) and then

the
macro runs up to the OpenText command then it gets a "Runtime error 1004:
Method OpenText of object Workbooks failed" note: the FileSystemObject
statement above executed fine on this one.

How can I code these statements so that they are version independent? Or
have logic that will detect the environment and only run the statements

that
will work.

--
Regards,
John