Jump to content

Get file name


Recommended Posts

Hi guys!!

I got a problem with working file identifying. Actually it is excel file and the purpose is to determine whole file name with path and extension, that is currently processing by excel.

Can you pleae write a small example to show me the right way of thinking?

Friendly yours, elect.

Edited by electrico
Link to comment
Share on other sites

Try this:

$oExcel = ObjGet('', 'Excel.Application')

; all WorkBooks
$colWorkBooks = $oExcel.Workbooks
For $WorkBook In $colWorkBooks
    ConsoleWrite($WorkBook.Path & '\' & $WorkBook.Name & @CRLF)
Next

; active WorkBook:
ConsoleWrite($oExcel.ActiveWorkbook.Path & '\' & $oExcel.ActiveWorkbook.Name & @CRLF)
Edited by BugFix

Best Regards BugFix  

Link to comment
Share on other sites

  • 1 month later...

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...