Unhiding sheets

mtairhead

Registered User.
Local time
Today, 08:50
Joined
Oct 17, 2003
Messages
138
Hi all!

Is there any way to unhide an Excel sheet from an Access mdb? I can do it in Excel, unhiding a workbook's own sheets, but I have no clue where to begin if I'm attempting it from a different file.

~Andrew
 
NM...I muddled it out. It took a lot of swearing, but it's here.

PHP:
Public Sub UnhideSheet()
Dim xlsApp As Object
Dim xlsBook As Object
Dim xlsSheet As Object
Dim fileName As String

fileName = fileName 'location and file of the XLS file you wish to change
   
Set xlsApp = CreateObject("Excel.Application")
Set xlsBook = xlsApp.Workbooks.Open(fileName)

xlsApp.Visible = True 'Set to False if you don't want to see the workbook load

'Sheets to set to visible
xlsBook.Sheets("Sheet1").Visible = True
xlsBook.Sheets("Sheet2").Visible = True
xlsBook.Sheets("Sheet3").Visible = True

'Save and quit
xlsApp.ActiveWorkbook.Save
xlsApp.Quit
 
Thanks for posting back with your success. If someone else finds themselves in that situation (and does a search, which is rare in itself) they will have the benefit of your swearing :)
 

Users who are viewing this thread

Back
Top Bottom