LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use excel range AdvancedFilter?

I want to use AdvancedFilter of Range object, but I'm getting error. Anybody knows how to use it? Depending upon the criteria I want to select values to display in drop down box.

 

Regards,

Shrinivas

0 Kudos
Message 1 of 8
(3,766 Views)

Hi Shrinivas,

 

you might consider to read the Excel help for that Excel related problem...

 

Which error?

What do you do to create that filter?

Do you program VBA or LabVIEW?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,761 Views)

I'm using LabVIEW. When I run it I'm getting:

 

Error -2146827284 occurred at Exception occured in Microsoft Excel: The text you entered is not a valid reference or defined name.Help Path is xlmain11.chm and context 0 in GetMotorTypesFromCharact.vi

This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.

Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2146827284) or for its hexadecimal representation (0x800A03EC).

0 Kudos
Message 3 of 8
(3,755 Views)

Hi Shrini,

 

when you run what? Please attach your VI and any related documents needed - or how should we hunt that error?

 

The error description is pretty clear: undefined error number due to error related to 3rd party/ActiveX object. It also mentions the help file explaining that error! Please read the help as already suggested above!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(3,752 Views)

My requirement is to select the values from column A satisfying criteria on coulmn B & C.

 

Regards,

Shrinivas

0 Kudos
Message 5 of 8
(3,751 Views)

Hi Shrini,

 

WHAT HAVE YOU DONE SO FAR?

 

When you need professional programming service you might offer a job in the suitable forum!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(3,748 Views)

Hi,

 

Attached is what I've done. Before adding AdvancedFilter, all the data from Column A was returned, but now I want to apply the criteria.

 

Regards,

Shrinivas

0 Kudos
Message 7 of 8
(3,728 Views)
It is expected that the UsedRange returned only column A before the criteria was added. But now the UsedRange returns all of your data and the criteria as a single block. This cannot be processed by the filter. Try specifying Range(A1,Range(A1).End(xlDown) as the data block. Also, the filter specification must be a range defining the criteria.

Your code does not use the variant output from the AdvancedFilter, which I suspect has the filtered results.

Ref: http://www.excelfunctions.net/ExcelAdvancedFilter.html
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 8 of 8
(3,350 Views)