Prev: From ListBox selection >labels on userform to show sheet cell valu
Next: VBA Pivot Table Change Criteria - Help?!
From: Hodge on 22 Apr 2010 07:51 Hi, I am having trouble accessing a particular XLSM spreadsheet via OleDB from vb.Net and FW 2.5. As the spreadsheet was given to me, I was unable to access the desired sheets. I was sanitizing the spreadsheet to send to someone and I went to run document inspector to see if I needed to clean any other information out. First, the inspector told me that it could not run because I had protected worksheets. So I unprotected the protected worksheets and re-ran the inspector. It told me that that I had 1 hidden worksheet. So I let it remove that. Anyway, once I had performed the above steps, I was able to access the desired worksheets. I also tried saving the original XLSM as an XLSX and got the same results as witht eh original XLSM file. I was able to access the data by saving the XLSM as an XLS file. As a test, I restored my copy and just removed the protection from the protected worksheets and did not unhide the other worksheet and was still unable to access the data without getting the error that I got before. I can only access the data after clicking on Remove All for the Hidden Worksheets. The problem now is that I was unable to find a worksheet to unhide from the Format/Hide and Unhide/Unhide sheet as this option was disabled. So I looked for any VeryHidden sheets via VBA (going through the worksheets collection) and visually in the project exlporer tree, but found nothing. Here's the code I used to look into the collection: Sub ShowSheets() Dim wks As Worksheet For Each wks In ActiveWorkbook.Worksheets MsgBox wks.Name & " - " & wks.Visible Next wks End Sub How can the document inspector see a hidden sheet and I cannot? Can you tell me whether or not the Remove All command for the hidden worksheet in the document inspector actually deletes or unhides a worksheet? Also, can you tell me exactly what should be able to stop me from being able to access the data? Items such as hidden worksheets/cells, protected worksheets/cells, etc. Thanks, Bobby |