asp中调用execel的问题。谢谢!

handwin 2003-10-17 09:44:45
我现在希望在asp中打开一个现有的execel文件。我试了一下,。open()方法中的参数怎么用啊?
...全文
19 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
iinohk 2003-10-17
  • 打赏
  • 举报
回复
execel????
那是啥?能吃嗎?
=========================另一人格==============================
試試這個
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set oExcel = CreateObject("Excel.Application")
fileExcel="a"
filePath= Server.mapPath(SitePath)
filename= filePath & "\reports\" & fileExcel&".xls"

if fs.FileExists(filename) then
Set oBook = oExcel.Workbooks.Open(filename)
Set oSheet = oBook.Worksheets("a")
oSheet.Cells.ClearContents
else
Set oBook = oExcel.Workbooks.add
Set oSheet = oBook.Worksheets(1)
oSheet.name="a"
end if

要編輯的話就編輯oSheet
ttt2 2003-10-17
  • 打赏
  • 举报
回复
rs.Open SQL1, conn, 3, 3
qdubit 2003-10-17
  • 打赏
  • 举报
回复
你可以使用面相对象的FSO对象,比如:copy、delete、move以及OpenAsTextStream等,不需要再使用传统的文件操作函数了,这样也很方便的。
ttt2 2003-10-17
  • 打赏
  • 举报
回复
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Excel Driver (*.xls)};ReadOnly=0;DBQ=" & Server.MapPath("注册表查询库.XLS")



SQL1="select * from [无格式表$]"
handwin 2003-10-17
  • 打赏
  • 举报
回复
up

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧