PDA

View Full Version : Hasheaders in listobjects.add method



prabhafriend
10-14-2010, 08:14 AM
Why this is giving error "Run-time error '5': Invalid procedure call or argument"
Workbooks("320_033110_Doral_Working").Sheets("Laser").ListObjects.Add(Source:=Workbooks("320_033110_Doral_Working").Sheets("Laser").Range("A6:R260"),TableStyleName:=xlyes).Name = "LaserList"

Why not for this?
Workbooks("320_033110_Doral_Working").Sheets("Laser").ListObjects.Add(Source:=Workbooks("320_033110_Doral_Working").Sheets("Laser").Range("A6:R260")).Name = "LaserList"

What the problem with that argument Tablestylename. I believe the argument name itself is wrong. It has to be Hasheaders. Am I right?

mbarron
10-14-2010, 09:30 PM
I think the TableStyleName only applies if you are importing data from an external source.