Jump to content
Sign in to follow this  
jfcby

Read Excel Worksheet Cell Value

Recommended Posts

jfcby

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
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
Sign in to follow this  

×