在Ruby中显示或隐藏标签页

Aspose.Cells - 显示或隐藏标签页

隐藏选项卡

要使用Aspose.Cells Java for Ruby隐藏标签页,请调用displayhidetabs模块。

Ruby 代码

 data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'

\# Instantiating a Workbook object by excel file path

workbook = Rjb::import('com.aspose.cells.Workbook').new(data_dir + 'Book1.xls')

\# Hiding the tabs of the Excel file

workbook.getSettings().setShowTabs(false)

\# Saving the modified Excel file in default (that is Excel 2003) format

workbook.save(data_dir + "output.xls")

puts "Tabs are now hidden, please check the output file."

使选项卡可见

通过将Workbook类的setSheetTabBarHidden(false)方法使标签页可见。

Ruby 代码

 # Displaying the tabs of the Excel file

workbook.getSettings().setSowTabs(true)

下载运行代码

从以下提到的任何社交编码站点下载隐藏或显示标签页 (Aspose.Cells)