以下是我要修复的代码。它适用于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
答案 0 :(得分: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)