Version Problem

M

Mian_Ghous

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
 
T

Tim Zych

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.
 
M

Mian_Ghous

well friend im not clear yet,,
my application work good for 2003 but i want it for 2000
no need for 2003
in 2003 value function has name value2 while in 2000 it has value name
so how to solve this problem..
actually client system gives error on 2003 because it dont have object for
11 or 12
it has object number 8
:(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top