Hello,.. Pak aku udah coba tapi masih bingung nih,.. bisa minta tolong pbl yang sederhana, dikirim ke email aku [EMAIL PROTECTED] aku lagi perlu banget upload Excel ke datawindows. contoh yg simpel aja, seperti file excel ini
kode kota JKT JAKARTA SUB SURABAYA JOG YOGYAKARTA maklum masih belajar nih,.. Ths, ya. >From: Pahala Sibuea <[EMAIL PROTECTED]> >Reply-To: [email protected] >To: [email protected] >Subject: [indopb] upload data dari excel >Date: Thu, 12 Apr 2007 23:31:39 -0700 (PDT) > >Teman... ini mungkin bisa membantu membantu tentang >upload data dari excel > > > >//// Import data dari file excel ke datawindow > >string ls_file,ls_Path,ls_item,ls_cmd,ls_excel >integer li_file_rc > > >// find the directory >if GetFileOpenName("Find " + ls_file, ls_Path, ls_file >) = 1 then > // open file excel > ls_excel = >ProfileString(ls_fileini,"DATABASE","excel","") > ls_cmd = ls_excel+ "EXCEL.EXE " + Trim(ls_Path) > > if RUN( ls_cmd, Minimized!) <> 1 then > MessageBox("Run Excel", "Unable to run Excel. Check >path name.", > Stopsign!) > Return > end if > // process transfer from excel to datawindow > string ls_datastring, ls_lokasi > integer li_maxcol, li_maxrow, li_index > boolean lb_kondisi > > IF len(dw_1.dataobject) > 0 then > setpointer(hourglass!) > > lb_kondisi = false > li_maxrow = 2 > DO WHILE not lb_kondisi > li_maxrow ++ > ls_lokasi = "R" + string(li_maxrow) + "C1:R" + >string(li_maxrow) > + "C1" > GetRemote(ls_lokasi, ls_datastring, "EXCEL", >ls_Path) > lb_kondisi = asc(left(ls_datastring,1))=13 and >asc(mid(ls_datastring,2,1))=10 > LOOP > > lb_kondisi = false > li_maxcol = 1 > DO WHILE not lb_kondisi > li_maxcol ++ > ls_lokasi = "R2C" + string(li_maxcol) + ":R2C" + > string(li_maxcol) > GetRemote(ls_lokasi, ls_datastring, "EXCEL", >ls_Path) > lb_kondisi = asc(left(ls_datastring,1))=13 and >asc(mid(ls_datastring,2,1))=10 > LOOP > > li_maxrow -- > li_maxcol -- > > ls_lokasi = "R2C1:R" +string(li_maxrow) + "C" + >string(li_maxcol) > IF GetRemote(ls_lokasi, ls_datastring, "EXCEL", >ls_Path) < 0 THEN > MessageBox("GetRemote", "Unable to get data from >Excel", >Stopsign!) > RETURN > END IF > > IF dw_1.ImportString(ls_datastring) < 0 THEN > MessageBox("Importstring", "DataWindow >ImportString() failed") > ELSE > setmicrohelp("Transferred rows : " + >string(dw_1.rowcount())) > END IF > ELSE > messagebox("Transfer Error", "Dataobject not >found!") > END IF > > // close file excel > if ExecRemote('[QUIT]',"EXCEL","SYSTEM") = 1 then > Messagebox('Info!','Process transfer finish') > else > Messagebox('Info!','Process transfer invalid') > end if > >end if > > > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com _________________________________________________________________ Download Messenger. Join the im Initiative. Help make a difference today. http://im.live.com/messenger/im/home/?source=TAGHM_APR07 ----------------------------------------------- IndoPB - Indonesia PB User Group An Indonesian PowerBuilder User Group's Event 2nd PowerBuilder Update Rumah Sakit Jantung Harapan Kita 26/27 August 2006 To Register : http://groups.yahoo.com/group/indopb/database?method=addRecord&tbl=4 Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/indopb/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/indopb/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> 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/
