在Excel 2010中编写的macros在Excel 2013中不起作用
我写了一个简单的macros来强制最终用户查看EULA,然后单击一个命令button来接受这些条款。 单击打开工作簿的选项卡,允许用户浏览本书。 这在Excel 2010和以前的所有版本中都能正常工作,但在Excel 2013中不能正常工作。
我得到这个错误:
这是代码:
Sub OpenSheets() ' ' OpenSheets Macro ' ' Sheets("EULA").Select Sheets("Infection_Worksheet").Visible = True Sheets("Infection_Worksheet").Select Sheets("Exit_Site_Infection_Chart").Visible = True Sheets("Exit_Site_Infection_Chart").Select Sheets("Peritonitis_Chart").Visible = True Sheets("Exit_Site_Infection_Chart").Select Sheets("%_Pts_peritonitis_free").Visible = True Sheets("%_Pts_peritonitis_free").Select Sheets("Pt_numbers").Visible = True Sheets("Pt_numbers").Select Sheets("Results").Visible = True Sheets("Results").Select Sheets("Instructions").Visible = True End Sub
有没有人有什么build议?
下划线表示VBA中下一行的延续。
试试这个Sheets("Infection" & Chr(97) & "Worksheet").Visible = True
等等等等