以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 请问下excel另存为副本时,修改文件名称该怎么写呢? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=85026) |
-- 作者:taoxian -- 发布时间:2016/5/16 10:30:00 -- 请问下excel另存为副本时,修改文件名称该怎么写呢? Dim Book As New XLS.Book(ProjectPath & "Attachments\\工资单.xls") dim Copyfl as string = "D:\\工资表\\format(e.DataRow("工资月份"),"yyyy")\\format(e.DataRow("工资月份"),"MM") " & e.DataRow("姓名") & format(e.DataRow("工资月份"),"yyyyMM") & ".xls" 另存为副本这样写可以吗?存到d盘工资表下,并按年、月生成文件夹,然后生成名称+年月为名称的.xls文件! dim Copyfl as string = "D:\\工资表\\format(e.DataRow("工资月份"),"yyyy")\\format(e.DataRow("工资月份"),"MM") " & e.DataRow("姓名") & format(e.DataRow("工资月份"),"yyyyMM") & ".xls" 求版主帮忙! |
-- 作者:大红袍 -- 发布时间:2016/5/16 10:35:00 -- Dim r As Row = Tables("表A").Current |
-- 作者:taoxian -- 发布时间:2016/5/16 10:53:00 -- 大红袍版主 我这样写 只打开了 个人工资表 但是没有生成文件 谢谢 Dim Book As New XLS.Book(ProjectPath & "Attachments\\个人工资表.xls") \'打开模板 Dim fl As String = ProjectPath & "Reports\\个人工资表.xls" Dim Sheet As XLS.Sheet = Book.Sheets(0) Book.Build() \'生成报表 Book.Save(fl) Dim Proc As New Process Proc.File = fl Dim r As Row = Tables("工价表").Current Dim Copyfl As String = "D:\\工资表\\" & format(r("几月工资"),"yyyy") & "\\" & format(r("几月工资"),"MM") & r("xingming") & format(r("几月工资"),"yyyyMM") & ".xls" Proc.Start() |
-- 作者:大红袍 -- 发布时间:2016/5/16 11:07:00 -- Dim Book As New XLS.Book(ProjectPath & "Attachments\\个人工资表.xls") \'打开模板 Dim fl As String = ProjectPath & "Reports\\个人工资表.xls" Dim Sheet As XLS.Sheet = Book.Sheets(0) Book.Build() \'生成报表 Book.Save(fl) Dim Proc As New Process Proc.File = fl Proc.Start() Dim r As Row = Tables("工价表").Current Dim Copyfl As String = "D:\\工资表\\" & format(r("几月工资"),"yyyy") & "\\" & format(r("几月工资"),"MM") & r("xingming") & format(r("几月工资"),"yyyyMM") & ".xls" FileSys.CopyFile(fl, copyfl, true) |
-- 作者:taoxian -- 发布时间:2016/5/16 11:13:00 -- 搞定 ,谢谢 |