Hi there!!
As the titles says i run the following code to unhide the 2 workbooks because are hidden with no luck The code updates 2 workbooks without to be visible to the user, but afterwards the two workbooks are hidden, so i want to unhidden them.
When it runs the--> "wbkObj.Workbook(1).Visible = True" there's an error
Im running vb6 & excel 2007
Please someone help me with this
Thanks a lot
--------------------------------------------------------
Sub ResaveAllWBsInFolder()
Dim PathDat As String
Dim BookName_1 As String
Dim BookName_2 As String
Dim wbkOld As Workbook
Dim wbkObj As Excel.Workbook
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.ShowWindowsInTaskbar = False
BookName_1 = "Main Source.xlsb"
PathDat = ThisWorkbook.Path & "\" & BookName_1
Set wbkObj = GetObject(PathDat)
Set wbkOld = Workbooks.Open(PathDat, UpdateLinks:=True)
Application.StatusBar = "Updating: " & BookName_1
Calculate
wbkObj.Workbook(1).Visible = True 'unhide the workbok
wbkOld.Save
wbkOld.Close
BookName_2 = "Joker SEK Source.xlsb"
PathDat = ThisWorkbook.Path & "\" & BookName_2
Set wbkObj = GetObject(PathDat)
Set wbkOld = Workbooks.Open(PathDat, UpdateLinks:=True)
Application.StatusBar = "Updating: " & BookName_2
Calculate
wbkObj.Workbook(1).Visible = True 'unhide the workbok
wbkOld.Save
wbkOld.Close
Set wbkObj = Nothing
Application.DisplayAlerts = True
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.ShowWindowsInTaskbar = True
Application.StatusBar = Empty
End Sub
As the titles says i run the following code to unhide the 2 workbooks because are hidden with no luck The code updates 2 workbooks without to be visible to the user, but afterwards the two workbooks are hidden, so i want to unhidden them.
When it runs the--> "wbkObj.Workbook(1).Visible = True" there's an error
Im running vb6 & excel 2007
Please someone help me with this
Thanks a lot
--------------------------------------------------------
Sub ResaveAllWBsInFolder()
Dim PathDat As String
Dim BookName_1 As String
Dim BookName_2 As String
Dim wbkOld As Workbook
Dim wbkObj As Excel.Workbook
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.ShowWindowsInTaskbar = False
BookName_1 = "Main Source.xlsb"
PathDat = ThisWorkbook.Path & "\" & BookName_1
Set wbkObj = GetObject(PathDat)
Set wbkOld = Workbooks.Open(PathDat, UpdateLinks:=True)
Application.StatusBar = "Updating: " & BookName_1
Calculate
wbkObj.Workbook(1).Visible = True 'unhide the workbok
wbkOld.Save
wbkOld.Close
BookName_2 = "Joker SEK Source.xlsb"
PathDat = ThisWorkbook.Path & "\" & BookName_2
Set wbkObj = GetObject(PathDat)
Set wbkOld = Workbooks.Open(PathDat, UpdateLinks:=True)
Application.StatusBar = "Updating: " & BookName_2
Calculate
wbkObj.Workbook(1).Visible = True 'unhide the workbok
wbkOld.Save
wbkOld.Close
Set wbkObj = Nothing
Application.DisplayAlerts = True
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.ShowWindowsInTaskbar = True
Application.StatusBar = Empty
End Sub