Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading cells from .xls

0 views
Skip to first unread message

RM

unread,
May 31, 2001, 11:24:35 AM5/31/01
to
Hi all,

I want to read the value of two cells from an Excel speadsheet(s) and stuff
them in to variables. Can anyone assist me or point me in the right
direction?

Lets assume...
Cells to read: A1 and C1
Variables: CellA1, CellC1

Thanks in advance,

RM


SteveYandl

unread,
May 31, 2001, 12:00:09 PM5/31/01
to
Assuming the XL file is on your desktop, is named text.xls, and the cells
are on sheet one, this will work as a vbs file.

Dim objXL, CellA1, CellC1
Set objXL = GetObject("C:\Windows\Desktop\test.xls")
CellA1 = objXL.sheets("sheet1").cells(1,1)
CellC1 = objXL.sheets("sheet1").cells(1,3)
Set objXL = Nothing


Note the cell references take the row number first and the column number
second.

Steve
"RM" <vich...@sdf.lonestar.org> wrote in message
news:eTA2PXe6AHA.2028@tkmsftngp07...

SteveYandl

unread,
May 31, 2001, 12:19:15 PM5/31/01
to
Obvious (hopefully) typo above. The Excel file on the desktop is assumed to
have the name test.xls, not text.xls as I typed<G>

Steve

"SteveYandl" <steve...@email.msn.com> wrote in message
news:OkXULre6AHA.1756@tkmsftngp07...

0 new messages