Chadtastic
New Member
- Joined
- Aug 26, 2007
- Messages
- 4
Hi all,
Here's the scenario....note I know why my code doesn't work the way I want it to, however, I don't know what to do to fix it! I'm hoping someone here can help me out.
I have an Excel workbook open with about 10 different sheets.
When I launch the macro, each sheet changes on the screen to the next sheet every couple of seconds.
Once we get to the last sheet, a web page pops up and displays some content.
The code below does this for me, however, once the Web page comes up and displays for a few seconds, the Excel workbook does not come back into view to run the loop of the spreadsheet pages again. I need it to do this all while the Web page that was initially opened STAYS opened but just sits in the background, not viewable.
Once the looping of the spreadsheets is finished, I need Excel to minimize and the Web page to come back into view, displaying exactly what it was displaying the first time it opened. So basically, I just need to show and hide the Web page after the loop of the spreadsheets is complete.
Wtih the below code that I have, the Web page just keeps opening new tabs. I'm not sure how to resolve this.
In addition, the Web page window does not minimize. I'm not sure where to put the minimize function in.
Can someone please help?
Thanks!
Sub MacroFlip()
' Macro2 Macro
Application.OnTime Now + TimeValue("00:01:00"), "MacroFlip"
Workbooks("ExcelWorkbook.xls").Activat…
Application.CommandBars("Standard").Vi… = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Formatting").Vi… = False
Application.DisplayFullScreen = True
Application.WindowState = xlMaximized
Sheets("Saturday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Sunday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Monday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Tuesday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Wednesday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Thursday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Friday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
ActiveWorkbook.FollowHyperlink Address:="http://www.website.com"
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 5
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Here's the scenario....note I know why my code doesn't work the way I want it to, however, I don't know what to do to fix it! I'm hoping someone here can help me out.
I have an Excel workbook open with about 10 different sheets.
When I launch the macro, each sheet changes on the screen to the next sheet every couple of seconds.
Once we get to the last sheet, a web page pops up and displays some content.
The code below does this for me, however, once the Web page comes up and displays for a few seconds, the Excel workbook does not come back into view to run the loop of the spreadsheet pages again. I need it to do this all while the Web page that was initially opened STAYS opened but just sits in the background, not viewable.
Once the looping of the spreadsheets is finished, I need Excel to minimize and the Web page to come back into view, displaying exactly what it was displaying the first time it opened. So basically, I just need to show and hide the Web page after the loop of the spreadsheets is complete.
Wtih the below code that I have, the Web page just keeps opening new tabs. I'm not sure how to resolve this.
In addition, the Web page window does not minimize. I'm not sure where to put the minimize function in.
Can someone please help?
Thanks!
Sub MacroFlip()
' Macro2 Macro
Application.OnTime Now + TimeValue("00:01:00"), "MacroFlip"
Workbooks("ExcelWorkbook.xls").Activat…
Application.CommandBars("Standard").Vi… = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Formatting").Vi… = False
Application.DisplayFullScreen = True
Application.WindowState = xlMaximized
Sheets("Saturday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Sunday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Monday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Tuesday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Wednesday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Thursday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Sheets("Friday").Select
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
ActiveWorkbook.FollowHyperlink Address:="http://www.website.com"
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 5
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime