Open webpage in macro based on date.

inksticks

New Member
Joined
Oct 27, 2005
Messages
2
I have a macro project that I'm creating in which excel opens a webpage. The webpage address is the following:

http://webapps.3abn.org/program/ViewWebSchedule.cfm?StartDate=11/01/2005&EndDate=11/30/2005&Net=1

In my macro I have the following command:

Code:
 Workbooks.Open Filename:= _
        "http://webapps.3abn.org/program/ViewWebSchedule.cfm?StartDate=11/1/2005&EndDate=11/30/2005&Net=1" _
        , ReadOnly:=True

This macro will be set to run every 14 days to update my tv schedule for my htpc. What I need to do is to program the first date in the url in my macro to change to today's date (the date the macro is run) and the 2nd date to change to 30 days later. For example if this macro is run on December 1 it would open the following url:

http://webapps.3abn.org/program/ViewWebSchedule.cfm?StartDate=12/01/2005&EndDate=12/30/2005&Net=1

If run on November 15 it would be:

http://webapps.3abn.org/program/ViewWebSchedule.cfm?StartDate=11/15/2005&EndDate=12/15/2005&Net=1

___________________________________________________________________

JLXL answered this question over at vbCity http://www.vbcity.com/forums/topic.asp?tid=113753&#RID361670
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
see this excel sheet particularly formulas in B7 down. will this of any help?this is the first time i am using html maker and sending it . hope you get the excel sheet. any problem send email to me.<HTML><HEAD><Script Langage JavaScript><!---
function ViewSource() {
var HtmlSource;
HtmlSource = document.all.ForSubmit.innerHTML;
HtmlSource = RetDeleted(HtmlSource);
document.write('<HTML><BODY BGCOLOR=#E0F4EA><CENTER><FORM><TEXTAREA ROWS=30 COLS=90%>');
document.write(HtmlSource);
document.write('</TEXTAREA></FORM></CENTER></BODY></HTML>');
}
function CopyToClipBoard() {
var HtmlSource;
HtmlSource = document.all.ForSubmit.innerHTML;
HtmlSource=RetDeleted(HtmlSource);
window.clipboardData.setData("Text",HtmlSource);
alert('Html source of above image\n\nhas been copied to your clip board\n\nJust paste it into Message Body\n\nIf you cannnot paste source from clip board,\n\nclick [View Source] button and paste manually.');
}
function RetDeleted(targetstring) {
if (targetstring.indexOf(unescape('%0D%0A')) > -1) rcode = unescape('%0D%0A')
else if (targetstring.indexOf(unescape('%0A')) > -1) rcode = unescape('%0A')
else rcode = unescape('%0D');
i = 0;
p = '';
while (targetstring.indexOf(rcode,i) != -1) {
m = targetstring.indexOf(rcode,i);
p += targetstring.substring(i,m);
i = m + rcode.length;
}
p += targetstring.substring(i,targetstring.length);
return p;
}</Script></HEAD><BODY BGCOLOR=#E0F4EA><CENTER><FONT COLOR=#339966 SIZE=5>[HtmlMaker 2.42]</FONT></CENTER><HR><SPAN id='ForSubmit'></SPAN><CENTER><HR><FORM NAME='form1'><INPUT TYPE='Button' value='Please click this button to send the source to clipbord' onClick='CopyToClipBoard();'><INPUT TYPE='Button' value='View Source' onClick='ViewSource();'></FORM><FONT COLOR=#339966 SIZE=2> This free code was written by Colo and Ivan F Moala:[HtmlMaker 2.42] - 15th May 2003</FONT><FONT COLOR=#339966 SIZE=2>Code mods by Ivan F Moala - 15th May 2003</FONT></HR></BODY></HTML>
 
Upvote 0
did you receive the spread sheet.
cells A7 downwards are the dates
B7 is the full url corresponding to the data in A7.
see formula pertaining to B7
now if you copy B7 and paste it to the address bar of your browser you get the schedule for 30 days beginning from 1 november
alternatle;y if you convert B7 into hyperlink you can just click it


now if you change the data in A7 to 11/5/05 B7 will automatically change
now if you copy B7 and paste it in your browser you will get the proramme of that web schesdule from 5 november for 30 days.

I have already entererd dates in A7 downwards from 1 november at 15 days intereval and at present you need not do any more entries. you have to copy the correspondign value in column B to the address bar of your browser.

confirm you gost the hand of it. vba is not required.
 
Upvote 0
did you receive the spread sheet.
cells A7 downwards are the dates
B7 is the full url corresponding to the data in A7.
see formula pertaining to B7
now if you copy B7 and paste it to the address bar of your browser you get the schedule for 30 days beginning from 1 november
alternatle;y if you convert B7 into hyperlink you can just click it


now if you change the data in A7 to 11/5/05 B7 will automatically change
now if you copy B7 and paste it in your browser you will get the proramme of that web schesdule from 5 november for 30 days.

I have already entererd dates in A7 downwards from 1 november at 15 days intereval and at present you need not do any more entries. you have to copy the correspondign value in column B to the address bar of your browser.

confirm you gost the hand of it. vba is not required.
 
Upvote 0

Forum statistics

Threads
1,219,162
Messages
6,146,661
Members
450,706
Latest member
LGVBPP

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