导出一个报告,从lightswitch excel,并试图在Excel中创build一个边框
我一直在尝试使用电灯开关在Excel中创build边框。 我创build的文件没有问题,我能够格式化文件,但我想要的。 但是,当把excel边框放在excel上时,我似乎无法做到
**Imports System.Runtime.InteropServices.Automation Imports System.Collections.Specialized** **With excel.Range("A5:M6") .Borders(excel.XlBordersIndex.xlInsideVertical).LineStyle = excel.XlLineStyle.xlContinuous End With**
有我使用的代码,以上是它的口号,因为我说eveything很好地禁止边界的创build。 系统不喜欢XlBordersIndex“调用XlBordersIndex – 找不到成员时出错”。 有什么我需要保证我已经从相当一段时间谷歌,找不到任何微软灯开关
它看起来像excel
是一个variables的名称 – 一个Application
,一个Worksheet
或其他具有一个Range
属性 – 与Excel
命名空间冲突。 也许尝试下列其中一项:
- 将
excel
variables重命名为别的东西 - 通过
Excel
引用XlBordersIndex
枚举(使用大写XlBordersIndex
E)。 - 通过完整的命名空间引用枚举:
System.Runtime.InteropServices.Automation.Excel.XlBordersIndex.xlInsideVertical