It has been around 2 weeks since I started working on excel vba. I have a sub which converts a range of data into a table:
Sub RangeToTable(fileName, sheetname, rng, tblNm)
With Sheets(sheetname)
.ListObjects.Add(xlSrcRange, .Range(rng), , xlYes).Name = tblNm
.ListObjects(tblNm).ShowHeaders = False
.ListObjects(tblNm).TableStyle = "TableStyleLight15"
End With
End Sub
This sub works fine on my development machine (Win 7, Office 2007). But on our lab computer which is running Win XP and office 2000, I am getting a run time error 438 object does not support this property or method at Add method. I have searched around for a solution and on MS website one of the causes of this problem is given as version mismatch, which is true in my case. Can you guys please let me know a good solution for my problem? Are there any work arounds? Does this mean that any macro which deals with tables (ListObjects), I won't be able to run on an excel version which does not support tables? Your help is appreciated, Thanks, DD.