首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VBA >

excel 2010里加入vba如何保存不了

2013-02-15 
excel 2010里加入vba怎么保存不了我新建了一个xlsx的excel 文件,在file-option--trust center--macro sett

excel 2010里加入vba怎么保存不了
我新建了一个xlsx的excel 文件,
在file-option--trust center--macro settings 里面选了enable all macros 和trust access to the vba project object model

然后按alt+F11
在Thisworkbook里面加了如下代码,用于保存时命名
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim Name As String
 
  With ThisWorkbook
 
    Name = Worksheets("Sheet1").Cells(3, 5).Value & ".xlsx"
 
    .SaveCopyAs Name
 
  End With
 
End Sub

但点save后提示

the following features cannot be saved in macro-free workbooks 
vb project 
to save a file with these features click no  and then choose a macro-enabled file type in the file type list.
to continue saving as a macro-free workbook, click yes


EXCEL 启用宏的工作薄 必须保存为.xlsm 宏才有效 如果保存为.xlsx 宏是无法使用的
请查看您excel表格的的拓展名

热点排行