I am trying to copy the format of an Cell say here \"A1\" to the all cells of the first row using VBScript,but getting an error xlValues
is not defined.
try:
ob3.Range("A1").Copy
ob3.Range("A1").EntireRow.PasteSpecial xlPasteFormats
You can find a list of constants here: http://techsupt.winbatch.com/ts/T000001033005F9.html
These are for Excel 97 but in your case (xlValues) the constant hasn't changed (-4163).
With
Const xlValues = -4163
...
ob3.Range("A1").Copy
ob3.Range("A1").EntireRow.PasteSpecial(xlValues)
you shouldn't get an error anymore
As VBScript does not know about Excel's constant, you'll have to define them yourself:
Const xlValues = 123 ' <-- replace 123 with the correct value for your version of Excel