Tag: 编译错误

编译事件处理程序子例程中的错误

我有一个脚本,应该在特定工作表中进行更改时运行,所以我在指定工作表中创build了一个Worksheet_Change()types的子工具。 但是,一旦进行了更改,VBA会为“ 错误的参数数量或无效的属性分配 ”吐出编译错误,并突出显示子项的第一行,即Private Sub Worksheet_Change(ByVal Target As Range) : Private Sub Worksheet_Change(ByVal Target As Range) Dim newVal As String Dim oldVal As String Dim pageEnd As Integer Dim oldRng As Range Dim newRng As Range Dim toolList As Range Dim语句之后,代码继续执行很多行。 我怎么能通过第一线?

创buildexcel文件 – 编译错误

我试过下面的代码,但没有好的,我无法创buildExcel文档,打开和closures它。 package tests; import java.io.*; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.util.*; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class Xls_Reader { Workbook wb = new XSSFWorkbook(); FileOutputStream fileOut = new FileOutputStream("workbook.xlsx"); } 我收到以下错误: Default constructor can not handle exception type FileNotFoundException thrown by implicit super constructor . Must define an explicit constructor. 有人可以帮助我理解使用POI API创buildExcel文件的概念吗?

Excel VBA不会在编译时捕获无效的属性

Excel / VBA编译器似乎不会在编译时捕获无效的属性。 这是一个简单的例子: Option Explicit Sub CompileExample() Application.Calculzzzzzzzzation = xlCalculationAutomatic End Sub 它会在运行过程中失败,但编译得很好。 通常这对我来说不会是一个问题,但我试图编译一些机器生成的代码,以显示错误而不执行它。 任何方式来强制编译器执行严格的检查?