以文本方式查看主题

-  蓝色快车PB俱乐部论坛  (http://pb.besoft.com.cnhttp://pb.besoft.com.cn/bbs/index.aspindex.asp)
--  PowerBuilder MIS编程  (http://pb.besoft.com.cnhttp://pb.besoft.com.cn/bbs/index.aspbbs.asp?boardid=1)
----  请问在pb里如何调用excel表?谢  (http://pb.besoft.com.cnhttp://pb.besoft.com.cn/bbs/index.aspdispbbs.asp?boardid=1&rootid=2718&id=2931)


--  作者:fly6555
--  发布时间:2005/3/13 14:51:02

--  请问在pb里如何调用excel表?谢
请问在pb里如何调用excel表?谢
--  作者:zephyrim
--  发布时间:2005/3/20 10:40:51

--  
留下联系方式,我发源码给你 11096334
--  作者:asgc_dgh
--  发布时间:2005/3/31 22:15:30

--  
你好!我也正好有这个问题,有答案了吗?若有请给我一份好吗?
asgc_dgh@yahoo.com.cn
--  作者:zhegao
--  发布时间:2005/5/9 13:40:48

--  
加入pb大联盟的qq群:9924870,我有源代码
--  作者:lyw717
--  发布时间:2005/6/29 10:24:07

--  
//oleobject excelapp,myworkbook
//long ret,i=2,j,row,ll_Find,ll_Count
//string docname,named,ls_number,ls_table,ls_col,ls_id,ls_customer_id,ls_zjm
//any la_data
//string ls_line_no,ls_UnitId,ls_Unit
//pointer oldpointer 
////往来户不能为空
//
//ret=GetFileOpenName("选择要导入报价单的文件",docname, named, "xls", &
//    + "Microsoft Excel 文件 (*.xls),*.xls,")
//if ret<>1 then return 
//ChangeDirectory ( gs_apppath )
//oldpointer = SetPointer(HourGlass!)
//excelapp=create oleobject
//ret=excelapp.connecttonewobject("excel.application")
//if ret<>0 then 
// destroy excelapp
// f_msg('连接excel失败,请确认已经安装EXCEL')
// return 
//end if
//excelapp.workbooks.Open(docname)//打开Excel文档
//myworkbook=excelapp.ActiveWorkBook
////excelapp.visible=true
////导入
//
////检索单位列表
//ds_Unit.SetTransObject(SQLCA)
//ds_Unit.Retrieve()
//ll_Count=ds_Unit.RowCount()
//
//do while true
// la_data=myworkbook.ActiveSheet.Cells[i,2].Value//名称
// if isnull(la_data) then //退出
//    MyWorkBook.saved = true
// MyWorkBook.close
// ExcelApp.Quit
// Excelapp.DisconnectObject()
// destroy excelapp
// SetPointer(oldpointer)
// return 
// end if
// if dw_Master.rowcount() <= 0 then
// dw_Master.Object.DataWindow.ReadOnly=false
// dw_Master.insertrow(0)
// ls_customer_id = dw_Master.object.customer_id[1]
// if isnull(ls_customer_id) or ls_customer_id = '' then 
// messagebox(gs_SoftName,"请填写客户信息!")
// return
// else
// select zjm
// into :ls_zjm
// from sal_client
// where id = :ls_customer_id;
// end if
// ls_table = 'sal_bj_m'
// ls_col = 'id'
// f_createmaxid(ls_table,ls_col,ls_id)
// dw_Master.object.id[dw_Master.getrow()] = ls_zjm + '_' + ls_id
// dw_Master.object.corp_id[dw_Master.getrow()] = '001'
// dw_Master.object.xj_date[dw_Master.getrow()] = today()
//end if
//
//string ls_name11 ,ls_model11,ls_spec11
//  ls_name11 =trim(dw_1.object.name[1])
//  if isnull(ls_name11) then ls_name11 =''
//  ls_model11 =trim(dw_1.object.model[1])
//  if isnull(ls_model11) then ls_model11 =''
//  ls_spec11 =trim(dw_1.object.spec[1])
//  if isnull(ls_spec11) then ls_spec11 =''
//  //f_msg(ls_name11 + 'asdf' + ls_model11 + 'asdf' + ls_spec11)
//  if  len(ls_name11)= 0 and len(ls_model11) = 0 and len(ls_spec11) =0 then
//       dw_1.deleterow(1)
// end if
//   
// row=dw_1.insertrow(0)
// ls_line_no = string(myworkbook.ActiveSheet.Cells[i,1].Value)
// if isnumber(ls_line_no) and not isnull(ls_line_no) and & 
//    integer(ls_line_no)> 0 then dw_1.object.line_no[row] = integer(ls_line_no)  //行号
// dw_1.object.name[row]=string(myworkbook.ActiveSheet.Cells[i,4].Value)//名称
// dw_1.object.model[row]=string(myworkbook.ActiveSheet.Cells[i,5].Value)//型号
// dw_1.object.spec[row]=Trim(string(myworkbook.ActiveSheet.Cells[i,6].Value))//规格
//
// //单位
// ls_Unit=string(myworkbook.ActiveSheet.Cells[i,7].Value)
// ll_Find=ds_Unit.Find("name='"+ls_Unit+"'",1,ll_Count)
// If IsNull(ll_Find) Or ll_Find<=0 Then
// SetNull(ls_UnitId)
// Else
// ls_UnitId=ds_Unit.GetItemString(ll_Find,"id")
// End If
// dw_1.object.unit_id[row]=ls_UnitId
//
//
// dw_1.object.project_no[row]=string(myworkbook.ActiveSheet.Cells[i,2].Value)//工程编号
// dw_1.object.place[row]=string(myworkbook.ActiveSheet.Cells[i,3].Value)//位号
// ls_number=string(myworkbook.ActiveSheet.Cells[i,8].Value)//数量
// if isnumber(ls_number) and not isnull(ls_number) and  &
// dec(ls_number)>0 then dw_1.object.goods_num[row]=dec(ls_number)
// dw_1.object.mlj[row]=dec(string(myworkbook.ActiveSheet.Cells[i,9].Value))//目录价
// ls_number=string(myworkbook.ActiveSheet.Cells[i,10].Value)
// //f_msg(ls_number)
//  dw_1.object.xj_price[row]=dec(ls_number)//单价
// dw_1.object.remark[row]=string(myworkbook.ActiveSheet.Cells[i,20].Value)//备注
//   dw_1.object.fd_fx[row]=string(myworkbook.ActiveSheet.Cells[i,11].Value)
// dw_1.object.sfl[row]=dec(myworkbook.ActiveSheet.Cells[i,12].Value)
// dw_1.object.current_price[row]=dec(myworkbook.ActiveSheet.Cells[i,13].Value)
// dw_1.object.money[row]=dec(myworkbook.ActiveSheet.Cells[i,14].Value)
//
// wf_sum(row)
// i++
//loop
//
--  作者:babynan110
--  发布时间:2007/2/7 15:50:49

--  
2楼的朋友 我的 QQ 31511164 
nannan@jlcfc.com
babynan110@163.com 
发给我一份 谢谢

">