想生成Excel表,其中:岗位代码列根据员工姓名自动生成,求代码!
Dim gwdzb As DataTable = DataTables("岗位对照表")
Dim ygbh As List(Of String) = gwdzb.GetValues("员工代码")
Dim ygxm As List(Of String) = gwdzb.GetValues("员工姓名","","员工代码")
Dim Book As New XLS.Book("\\Bddfzlzh-kh\中国建设银行绩效考核系统\EXCEL报表模板文件\员工产品销售目标表.xls") '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
Sheet(0,0).Value = "员工产品销售目标表"
Sheet(2,0).Value = "员工编号"
Sheet(2,1).Value = "员工姓名"
Sheet(2,2).Value = "岗位代码"
For i As Integer = 0 To ygxm.Count - 1
Sheet(i + 4, 0).Value = ygbh(i)
Sheet(i + 4, 1).Value = ygxm(i)
Sheet(i + 4, 2).Value = “不知道咋写了?”
Next
Forms("进度显示").close
'打开工作簿
Book.Save("\\Bddfzlzh-kh\中国建设银行绩效考核系统\EXCEL报表\员工产品销售目标表.xls")
Dim Proc As New Process
Proc.File = "\\Bddfzlzh-kh\中国建设银行绩效考核系统\EXCEL报表\员工产品销售目标表.xls"
Proc.Start()