Version Problem
If you don't need the extra parameters, omit them and the code should work
in both versions. But if you need them for 2003, you can modify the
Workbooks.Open to perform late binding if the version is 2003 or later. For
example I know that Excel 2003 complains if there is an invalid worksheet
name, say a data dump created by a non-Excel app which has invalid
characters in it, and the CorruptLoad parameter can be used to allow the
macro to continue.
If Val(Application.Version) = 11 Then
' XL 2003+, so use late bound approach
Dim objWkb As Object
Dim objWkbs As Object
Set objWkbs = Workbooks
' Using the CorruptLoad parameter
Set objWkb = objWkbs.Open("<filename.xls", False, True, , , , , , ,
, , , , , 1)
Else
' Use the XL 2000 or prior workbook approach
Set objWkb = Workbooks.Open("<filename.xls", False, True)
End If
Also, the Value property exists both 2000 and 2003.
--
Tim Zych
SF, CA
"Mian_Ghous" wrote in message
...
Hi All
i have come across a little problem ..
i am using excel object to create excel file from some data ..
problem is that im using office 2003 object and ma client is using office
2000.
my method
excelworksbook.open()
takes 15 parameter but in 2000 it takes just 13 parametes so it causes
problem....
2nd
in excel 2000 the function is cell.value2()
while in 2003 it is cell.value()
client can not use office 2003 and i have no time to completly wewrite the
code
|