View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Layzell David Layzell is offline
external usenet poster
 
Posts: 2
Default VBScript MS Excel Problem

Hi All,

Just wondering if anyone knows the correct way to pass arguments to the
autofilter method when using VBScript to automate MS Excel. Below, please
find a code snippet that keeps failing.

Code:
Set o_excel = CreateObject("excel.application")
o_excel.visible = True
o_excel.workbooks.open v_file + ".csv"
Set o_wrksht = o_excel.activesheet
o_wrksht.cells(2, 1).autofilter
o_wrksht.cells(2, 10).autofilter 10, "="
The last line returns an error, "Autofilter Method Of Range Class Failed".
Does anyone have any suggestions?