1,106
社区成员




```c++
ExcelServer = CREATE OLEObject
ExcelOK = ExcelServer.ConnectToNewObject( "excel.application" )
if excelok < 0 then
// messagebox("连接excel失败,检查你的系统是否安装了office",string(excelok))
// return(-1)
ExcelOK = ExcelServer.ConnectToNewObject( "et.application" )
if excelok < 0 then
ExcelOK = ExcelServer.ConnectToNewObject( "ket.application" )
if excelok < 0 then
messagebox("连接excel和et都失败了,请检查你的系统,至少安装office或wps企业版中的一种办公软件。",string(excelok))
return(-1)
end if
end if
end if
```
差不多吧,connection链接时excel换成wps,应该可以了,也可以去wps网站上去问问。