请问如何用PB实现象上述VFP
的应用,好让我能将资料放到一个电子表格
答:差不多,给个代码:
方法一:
OLEObject ExcelServer
integer ExcelOK
ExcelServer = CREATE OLEObject
ExcelOK = ExcelServer.ConnectToNewObject( "excel.application" )
ExcelServer.Workbooks.Open("c:\book.xls")
ExcelServer.ActiveWorkBook.Sheets("Sheet2").Select
ExcelServer.ActiveSheet.Cells(1,1).value = "书名"
ExcelServer.Application.Visible = TRUE
方法二:先启动excel文件
long handle_1
handle_1 = OpenChannel("Excel", "c:\book.xls")
//建立与EXCEL的通道
setremote("r1c1","书号","excel"," c:\book.xls")
setremote("r1c2","书名","excel"," c:\book.xls")
//更改某一行或某一列的值,同时关闭通道
closechannel(handle_1,handle(parent))