Jump to content

Getting file objects in Excel?


Recommended Posts

Looking at the examples provided here and in the Help file, I can't figure out how to get directly to the worksheet object.

I'm trying to start Excel using normal AutoIt commands (not COM), then open a file, again not using COM. After the file is open, I need to copy a range and work with autofilter.

However, the examples in the ExcelCOM_UDF seem to always use the Excel app object and base off of ActiveSheet from there. The help file shows making an object by specifying the spreadsheets absolute path and working from there.

Is there a way to directly access workbork and thus worksheet directly without using these methods, or is this the way you should do it?

Trying to reconcile the documentation available for Excel COM and what you would do in AutoIt ain't easy. :-)

Thanks for your time.

Link to comment
Share on other sites

Looking at the examples provided here and in the Help file, I can't figure out how to get directly to the worksheet object.

I'm trying to start Excel using normal AutoIt commands (not COM), then open a file, again not using COM. After the file is open, I need to copy a range and work with autofilter.

However, the examples in the ExcelCOM_UDF seem to always use the Excel app object and base off of ActiveSheet from there. The help file shows making an object by specifying the spreadsheets absolute path and working from there.

Is there a way to directly access workbork and thus worksheet directly without using these methods, or is this the way you should do it?

Trying to reconcile the documentation available for Excel COM and what you would do in AutoIt ain't easy. :-)

Thanks for your time.

I can help, but COM really is the way to go. Are you trying to open a spreadsheet on a system that doesn't have excel? I ask that because that makes sense as a reason to want to try to avoid com to open a sheet.

Link to comment
Share on other sites

  • 8 months later...

I am having trouble enabling AutoFilter in Excel also. The macro in VB looks like:

Sheets("Sheet1").Select

Range("A1").Select

Selection.AutoFilter

I am trying:

$oExcel.activesheet.Range("A1").select

$oExcel.selection.autofilter

I get a COM error though 'Unable to get the AutoFilter property of the Range class" (number 80020009)

Any help is appreciated.

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...