Jump to content

Tarakos

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

28 profile views

Tarakos's Achievements

  1. Ok, I think to have solved it. This is what I found: ; #FUNCTION# ==================================================================================================================== ; Name...........: _ExcelBookOpen ; Description ...: Opens an existing workbook and returns its object identifier. ; #FUNCTION# ==================================================================================================================== ; Name...........: _ExcelBookAttach ; Description ...: Attach to the first existing instance of Microsoft Excel where the search string matches based on the selected mode. ; Return values .: Success - Returns an object variable pointing to the Excel.Application, workbook object So my code becomes: #Include <Excel.au3> $oExcel = _ExcelBookAttach("C:\test.xls") $sCell = $oExcel.Application.ActiveCell.Row It was really simple...... and now possible!! Thanks to JLogan for the idea!!! Bye,
  2. But if I have the file excel opened (that is my case), there is another way to solve the problem? I've tried to adapt my code with _ExcelBookOpen, but it solves the "ActiveCell" problem, but it gives me other problems with my code. I would like to study in deep the reason why ActiveCell doesn't work with an object like _ExcelBookAttach("C:test.xls"). There are different "objects" ??? I'd rather to leave _ExcelBookAttach("C:test.xls") in my code, so the question of my topic is still unanswered. Thank you to all other suggests.
  3. Thanks for your suggest. The error is in "_ExcelBookAttach" ; with _ExcelBookOpen, it works. I don't understand, but it works!
  4. Hello to everybody, what I want to know is which row and which column is the active cell in the file excel. I think it's really simple, but I've tried my best and I didn't succeed. I haven't find anything in internet. Help me, please! I use the file "test.xls" to write many records, but I want to know WHERE I'm writing the records BEFORE the records are written and before writing anything in the sheet. The ActiveCell may be everywhere in the sheet. #Include <Excel.au3> $oExcel = _ExcelBookAttach("C:test.xls") $TheRow = $oExcel.ActiveCell.Row The error is: $TheRow = $oExcel.ActiveCell.Row $TheRow = $oExcel.ActiveCell^ ERROR Error: The requested action with this object has failed Someone would correct my code, please?
×
×
  • Create New...