Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 552 Vote(s) - 3.42 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hide Excel tab from Javascript code

#1
How can I hide an Excel tab programmatically through Javascript.
ExcelSheetName.Visible=False doesn't seem to work. I've googled a lot but yet not received the right solution. How to do that ?
Reply

#2
To hide an Excel sheet, set the `Visible` property of the corresponding `Worksheet` object to `0` or `false`.
For example, if you have an Excel file with two sheets named *Sheet1* and *Sheet2*, the following code will open this file with the *Sheet1* hidden:

var objExcel = new ActiveXObject("Excel.Application");
objExcel.Visible = true;
objExcel.Workbooks.Open("C:\\Book1.xlsx");

objExcel.ActiveWorkbook.Sheets("Sheet1").Visible = false;
// You can aslo use this --
//objExcel.ActiveWorkbook.Sheets("Sheet1").Visible = 0; // xlSheetHidden

<br/>
> So I said as u pointed out. This is my code:

> var fso = new ActiveXObject("Scripting.FileSystemObject");
> var xl = new ActiveXObject("Excel.Application");
> xl.Visible = true;
> var wb = xl.Workbooks.Open(fso.GetAbsolutePathName("Temp.csv"));
> xl.ActiveWorkbook.Sheets("Temp").Visible = false;

> But on doing so, I get the error as Unable to set the Visible property of the Worksheet class. Any clue what could be the possible error ?

The error is because CSV files have only one tab in Excel, and you can't hide the only visible tab. At least 1 tab must always be visible.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through