XEROF

 

xlsgen 2.9 build #48 : helpers for VBScript


Build 2.9.0.48 of xlsgen adds a couple helpers for the VBScript language. These are necessary because the VBScript language does not lend itself too much to data manipulations. A new helpers interface is available. Particularly these are useful for wrapping ILockBytes in VARIANTs (VBScript's native data type) and vice versa.

Here is a code sample :

' xlsgen_clientside_read.vbs
' to run this code, double-click on the .vbs file
'
' demonstrates how to update an existing .xls file in memory using VBScript
' for the purpose of the sample, the output buffer is written back to a file

Dim szProcessingFolder
szProcessingFolder = "c:\"

Dim engine
Set engine = CreateObject("ExcelGenerator.ARsTdesign")

' create a memory buffer host
Dim lb
lb = engine.helpers.ILockBytes_New

' open an existing Excel file, and retrieve a workbook
Dim wbk
Set wbk = engine.OpenInMemory(szProcessingFolder & "input.xls", lb, 3)

' create a new worksheet
Dim wksht
Set wksht = wbk.AddWorksheet("sheet1")

' sample code
wksht.Label(9,1) = "hello world!"
' your code begins here
' ...

wbk.Close

' convert the output to a regular memory buffer (byte array)
Dim byteArrayBuffer
byteArrayBuffer = engine.helpers.ILockBytes_Write(lb)

' for the purpose of the sample, write back to a regular file
engine.helpers.WriteFile szProcessingFolder & "myfile.xls", byteArrayBuffer

' free the memory
Set engine = Nothing

Posted on 11-February-2010 13:44 | Category: xlsgen, Excel generator | comment[0] | trackback[0]

 

 

<-- previous page

< February >
0102030405
0607080910
1112131415
1617181920
2122232425
262728



 

 

This site
Home
Articles

DevTools
CPU-Z
EditPlus
ExplorerXP
Kill.exe
OllyDbg
DependencyWalker
Process Explorer
autoruns.exe
Araxis
COM Trace injection
CodeStats
NetBrute
FileMon/Regmon
BoundsChecker
AQTime profiler
Source monitor
GDI leaks tracking
Rootkit revealer
Rootkit removal
RunAsLimitedUser(1)
RunAsLimitedUser(2)

 

 

Liens
Le Plan B
Un jour à Paris
Meneame
Rezo.net (aggr)
Reseau voltaire
Cuba solidarity project
Le grand soir
L'autre journal
Le courrier suisse
L'Orient, le jour
Agoravox (aggr)