0

下面是我正在尝试修复的代码。它适用于 Excel 2007,但不适用于 Excel 2010。

我相信它与 XlDBF4 部分有关。请帮忙。

Range("A1").Select
ActiveWorkbook.SaveAs Filename:=Range("SetUp!L34") & Range("SetUp!D28") & "_" & Range("SetUp!F28") & ".dbf", FileFormat:= _
    xlDBF4, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=Range("Setup!L28") & Range("SetUp!D28") & "_" & Range("SetUp!F28") & " " & Range("SetUp!D30") & ".xls", FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
    , CreateBackup:=False
4

1 回答 1

1

试试这个代码:

Range("A1").Select
ActiveWorkbook.SaveAs Filename:=Range("SetUp!L34") & Range("SetUp!D28") & "_" & Range("SetUp!F28") & ".dbf", FileFormat:= _
    xlDBF4, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=Range("Setup!L28") & Range("SetUp!D28") & "_" & Range("SetUp!F28") & " " & Range("SetUp!D30") & ".xls", FileFormat:= _
    xlExcel8, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
    , CreateBackup:=False

我认为情况是xlNormal:如果你愿意xls- 你应该xlExcel8改用。奇怪的是您的代码有效 - 根本没有xlNormal常量:XlFileFormat Enumeration (Excel)

于 2013-02-11T19:19:16.477 回答