Sign in to follow this  
Followers 0
Ram

Help on Excel

4 posts in this topic

I would like to read and write on sheet2 of an excel file. Is this possible? I know how to write and read on sheet1...but not sheet2 directly?

Can someone help me out?

Awaiting your response!

Share this post


Link to post
Share on other sites



I would like to read and write on sheet2 of an excel file. Is this possible? I know how to write and read on sheet1...but not sheet2 directly?

Can someone help me out?

Awaiting your response!

Try searching this forums for "excelcom". If it doesn't have anything useful, you have to use COM access (read manual and google for excel com/vba)

Share this post


Link to post
Share on other sites

Try searching this forums for "excelcom". If it doesn't have anything useful, you have to use COM access (read manual and google for excel com/vba)

Nope. I'm actually using ExcelCOM_UDF.au3 for reading Sheet1 of an excel file. I would like read sheet2 on the same excel file. So to read sheet1 I did this ... now to read sheet2

$oExcel = _ExcelBookOpen("D:\name.xls")

$aColumnA = _ExcelReadArray ($oExcel, 1, 1, 7, 1)

$aColumnC = _ExcelReadArray ($oExcel, 1, 3, 7, 1)

$aColumnD = _ExcelReadArray ($oExcel, 1, 4, 7, 1)

$aColumnE = _ExcelReadArray ($oExcel, 1, 5, 7, 1)

$aColumnF = _ExcelReadArray ($oExcel, 1, 6, 7, 1)

$aColumnG = _ExcelReadArray ($oExcel, 1, 7, 7, 1)

$aColumnH = _ExcelReadArray ($oExcel, 1, 8, 7, 1)

$aColumnI = _ExcelReadArray ($oExcel, 1, 9, 7, 1)

$aColumnJ = _ExcelReadArray ($oExcel, 1, 10, 7, 1)

So I have another set of data in Sheet2 on the same excel file Name.xls

Let me know how to create an array for that like above?

Awaiting your response!

Share this post


Link to post
Share on other sites

Use _ExcelSheetActivate():

_ExcelSheetActivate($oExcel, 2)

The second parameter is either an integer sheet number (as above) or a sheet name string.

Once the sheet you want is activated, you can then read & write from/to it.

Good luck with your Excel endeavors!

-S


(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]

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  
Followers 0