Spreadsheet loop and Web page launch

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
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,214,861
Messages
6,121,973
Members
449,059
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top