VBScript MS Excel Problem

Discussion in 'Software' started by Mada_Milty, Aug 18, 2006.

  1. Mada_Milty

    Mada_Milty MajorGeek

    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
    [B]o_wrksht.cells(2, 10).autofilter 10, "="[/B]
    The last line returns an error, "Autofilter Method Of Range Class Failed". Does anyone have any suggestions?
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    Okay, I got her figured out. There was no data in the selected column at the time that the "failing" command was issued...duh Milty.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds