Jump to content

Read Excel Worksheet Cell Value


Recommended Posts

Hello,

I'm working with an Excel Worksheet where I need to read cell values and store them in a varible to use in the script.

Is there a way to check if the workbook open?

Can the following script be modified to read cell values if the workbook is already open?

#include <Excel.au3>

$sFilePath1 = "C:\Documents and Settings\User\Desktop\ScriptProect\FFPM\Equip_List_FF.xls"
$oExcel = _ExcelBookOpen($sFilePath1)

Sleep(2000)

$sCellValue = _ExcelReadCell($oExcel, 4, 1)
MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2)

Thank you for your help,

jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Link to comment
Share on other sites

Hello,

I'm working with an Excel Worksheet where I need to read cell values and store them in a varible to use in the script.

Is there a way to check if the workbook open?

Can the following script be modified to read cell values if the workbook is already open?

#include <Excel.au3>

$sFilePath1 = "C:\Documents and Settings\User\Desktop\ScriptProect\FFPM\Equip_List_FF.xls"
$oExcel = _ExcelBookOpen($sFilePath1)

Sleep(2000)

$sCellValue = _ExcelReadCell($oExcel, 4, 1)
MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2)

Thank you for your help,

jfcby

In the UDF: _ExcelAttach()

Updated function from big_daddy: _ExcelBookAttach()

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...