Home  >  Article  >  Backend Development  >  php com组件操作excel有关问题

php com组件操作excel有关问题

WBOY
WBOYOriginal
2016-06-13 12:01:231348browse

php com组件操作excel问题
大家好,我想问下,我有一个excel表格,想设置单元格的边框,在网上找了很久也找不到。
现在是找到的是设置单元格值的方法:

$workbook = "D:\a.xls"; 
//启动Excel 
$ms_excel=new COM("excel.application") or die("不能打开Excel应用程序");

$ms_excel->WorkSheets('Sheet1')->Range('A1')->Value = "序号";

想请教大家,如果我想把
A1这个单元格设置有边框该如何操作,谢谢~
------解决方案--------------------
1、如果你的 excel 是完全安装的,那么在 工具 -- 宏 -- Microsoft脚本编辑器 中就有完整的帮助手册
  但遗憾的是,目前大多使用的是简化版的 excel,安装他需要安装光盘
2、既然没有能从 excel 中得到帮助,那么可从 phpexcel 知道用法。phpexcel 完全模拟了 vba 的操作
  所以用 phpexcel 写的代码可以用于 com 应用
------解决方案--------------------
用phpexcel类就很好解决
http://www.cnblogs.com/icgg/articles/1647064.html

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn