Sign in to follow this  
Followers 0
litlmike

Excel Udf Help

2 posts in this topic

I have taken a look at the Excel UDF, and can't make much sense of it.

1) How do I create and excel file?

2) How do I create a worksheet on that excel file?

3) How do I add data to a worksheet on that excel file?

Thanks in advance.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

1) How do I create and excel file?

_XLCreateBlank($s_FilePath)

2) How do I create a worksheet on that excel file?

This is only needed if you wish to create an additional sheet.

_SheetAdd($sFilePath, $Sheet, $ExcelValue)

3) How do I add data to a worksheet on that excel file?

_XLwrite($sFilePath, $Sheet, $Column, $Row, $ExcelValue)

Here is an example:

#include <ExcelCom.au3>

$FilePath = @ScriptDir & "\Test.xls"
_XLCreateBlank($FilePath)
_XLWrite($FilePath, 1, "A", 1, "This", "Visible")
_XLWrite($FilePath, 1, "A", 2, "is", "Visible")
_XLWrite($FilePath, 1, "A", 3, "a", "Visible")
_XLWrite($FilePath, 1, "A", 4, "test", "Visible")

Edit:Added an example

Edited by big_daddy

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