Sunday, 17 February 2019

How to Unhide Sheet all tab from Excel

OnErrorResumeNext
'vMasterFilePath=WScript.Arguments(0)
'vLogPath=WScript.Arguments(1)

vMasterFilePath="C:\Users\admin\Desktop\Operation\Data.xlsx"
vLogPath="C:\Users\admin\Desktop\Operation\Log.txt"

'For
writethelog'
Set
objFS=CreateObject("Scripting.FileSystemObject")
Set
FSO_Handle=objFS.OpenTextFile(vLogPath,8,True)

Set
objExcel=CreateObject("Excel.Application")
objExcel.DisplayAlerts
=False
objExcel.Visible
=True
Set
objWorkbook1=objExcel.Workbooks.Open(vMasterFilePath)


For
EachwksInobjWorkbook1.Worksheets
MsgBox("sheet
name"&wks.Name)

If
objExcel.Worksheets(wks.name).visible=FalseThen
MsgBox(wks.Name)
objExcel.Worksheets(wks.name).visible=True
count=count+1
End
If

If
wks.autofilterModeThen
wks.autofilterMode
=False
End
If
objExcel.Worksheets(wks.name).range("A1:BY100").ClearOutline

Next

objWorkbook1.Save
objWorkbook1.Close
True
objExcel.Quit




0 comments:

Post a Comment