I. Buat satu datawindow dengan datasource external
Datawindow ini nanti akan menampung data dari excel file
II. Buat menempatkan excel ke datawindow yg baru dibuat coba script ini:
OLEObject excel
Integer li_RetValue, li_rtn
Boolean lb_sheet_rtn
Long ll_cnt
integer loops, i,fh, ret,result
long flen, bytes_read, new_pos
boolean tol
blob b,lb_object,lblob_foto
string txtname1, named,namafile,id
string defext = "*.xls"
string Filter = "Microsoft Excel (*.xls),*.xls"
int li_rc, num_same_id,same_id,fhandle,baris
dw_1.reset()
if GetFileOpenName("Select file to open", ls_path, ls_filename, defext,
filter) = 1 then
if ls_filename = "" then return
excel = create OLEObject
li_rtn = excel.ConnectToNewObject("excel.application")
IF li_rtn <> 0 THEN
MessageBox('Excel error','can not run Excel Program')
DESTROY excel
RETURN 0
END IF
excel.WorkBooks.Open(ls_path)
excel.Application.Visible = false
excel.windowstate = 2 // 1 : Normal, 2 : Minimize, 3 : Maximize
lb_sheet_rtn = excel.worksheets(1).Activate
excel.Worksheets(1).Range("A2:E5000").Copy // copy to clipboard
ll_cnt = dw_1.importclipboard()
IF ll_cnt <= 1 THEN
Messagebox("Inf", "Could not find .")
END IF
excel.Worksheets(1).Range("A10000:A10000").Copy //reset clipboard
excel.Application.Quit
excel.DisConnectObject()
DESTROY excel
end if
III. Klo mo copy per column, tinggal diatur baris syntax terutama range nya,
misalnya kolom A
excel.Worksheets(1).Range("A2:A5000").Copy
IV. Semoga berhasil
Iwan Noviarsyah
Software Engineer
PT. Bamas Telematika Mandiri
62-21-5265236
08129768174
[EMAIL PROTECTED]
-------Original Message-------
From: [EMAIL PROTECTED]
Date: 09/14/04 09:11:23
To: [EMAIL PROTECTED]
Subject: [indopb] *xls file
DH,
Saya mau tanya...kalo mau baca file bertipe .xls, cara nya pake apa ya ?
maksud saya baca per-column di xls nya...:)
mohon bantuan nya..
thanx
regards,-
Rio
[Non-text portions of this message have been removed]
IndoPB - Indonesia PB User Group
To Post a message, send it to: [EMAIL PROTECTED]
To Unsubscribe,send a blank message to: [EMAIL PROTECTED]
Yahoo! Groups Sponsor
ADVERTISEMENT
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/indopb/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/NhFolB/TM
--------------------------------------------------------------------~->
IndoPB - Indonesia PB User Group
To Post a message, send it to: [EMAIL PROTECTED]
To Unsubscribe,send a blank message to: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/indopb/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/