Re: Formatting a Date in a Cell in Excel

2005-12-19 Thread Dennis Kelly
PS - you can also use [Format][cell][Number tab] and select custom. Then 
specify mmm  this will allow excel to treat it as a numeric 
quantity, and still have it be presented as you wish.


Glen Plantz wrote:


Hi Folks,
 
I'm having trouble formatting the Cell Contents of an Excel sheet with 
Win32::OLE.
 
I want to force the contents of a Cell that has a DATE value ( Dec 
2005 ) to be a string.

What happens is the Date value 'DEC 2005' in converted into 'Dec-05'.
 
Any help will be greatly appreciated
 
Thanks,


Glen Plantz
 
Here is my code;.

---
my ($currentMonth, $currentYear ) = split / /, 
$currentMonthYear;  # holds Dec 2005
 
# Now open the TEMPLATE FILE where this month value will be used...

# $CSAA_A2_RegionOffice

my $template_Workbook = $excel_app-Workbooks-Open($CSAA_A2_RegionOffice)
or die could not open $CSAA_A2_RegionOffice\n;
 
#now select first column heading where HOA will be used... and try 
putting the correct column heading in...

my $Sheet1 = $template_Workbook-Worksheets(1);
$Sheet1-Range(D2)-Select();

#now select correct array based on the '$currentMonth' value
my $mnth;
my $i = 0;
 
my $mnth = $HOA{$currentMonth}[$i];   # $mnth holds 'DEC'
 
#correct value... now try putting in the correct value...
 
my $monthYear = $mnth . '  ' . $currentYear;
 
print monthYear = $monthYear\n;
 
# my $dt = Variant(VT_DATE, $monthYear);

print $dt\n;
print $dt-Date(MMM ), \n;
 
my $formatedDate = $dt-Date(MMM ), \n;

print formatedDate = $formatedDate\n;
 
# this works, but the year has the format '05' see screen shot...

$Sheet1-Range(D2)-{'Value'} = $monthYear;
 
# this does not work

#$Sheet1-Range(D2)-{'Value'} = $formatedDate;
 
#this doesn't seem to effect the value entered...

#$Sheet1-Range(D2)-Format(MMM );
 
 




___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 



--

R. Dennis Kelly



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Formatting a Date in a Cell in Excel

2005-12-19 Thread Dennis Kelly
You can probably accomplish what you want by doing [Format][Cell][Number 
tab] and selecting text.
Excel likes to infer that cells are dates because then it can treat them 
as an ordered list, and you can do arithmetic like this day next week = 
today + 7. Under [Format][Cell][Number tab] the date selection has a 
number of good options for date presentation, but none seem to meet your 
needs.


Glen Plantz wrote:


Hi Folks,
 
I'm having trouble formatting the Cell Contents of an Excel sheet with 
Win32::OLE.
 
I want to force the contents of a Cell that has a DATE value ( Dec 
2005 ) to be a string.

What happens is the Date value 'DEC 2005' in converted into 'Dec-05'.
 
Any help will be greatly appreciated
 
Thanks,


Glen Plantz
 
Here is my code;.

---
my ($currentMonth, $currentYear ) = split / /, 
$currentMonthYear;  # holds Dec 2005
 
# Now open the TEMPLATE FILE where this month value will be used...

# $CSAA_A2_RegionOffice

my $template_Workbook = $excel_app-Workbooks-Open($CSAA_A2_RegionOffice)
or die could not open $CSAA_A2_RegionOffice\n;
 
#now select first column heading where HOA will be used... and try 
putting the correct column heading in...

my $Sheet1 = $template_Workbook-Worksheets(1);
$Sheet1-Range(D2)-Select();

#now select correct array based on the '$currentMonth' value
my $mnth;
my $i = 0;
 
my $mnth = $HOA{$currentMonth}[$i];   # $mnth holds 'DEC'
 
#correct value... now try putting in the correct value...
 
my $monthYear = $mnth . '  ' . $currentYear;
 
print monthYear = $monthYear\n;
 
# my $dt = Variant(VT_DATE, $monthYear);

print $dt\n;
print $dt-Date(MMM ), \n;
 
my $formatedDate = $dt-Date(MMM ), \n;

print formatedDate = $formatedDate\n;
 
# this works, but the year has the format '05' see screen shot...

$Sheet1-Range(D2)-{'Value'} = $monthYear;
 
# this does not work

#$Sheet1-Range(D2)-{'Value'} = $formatedDate;
 
#this doesn't seem to effect the value entered...

#$Sheet1-Range(D2)-Format(MMM );
 
 




___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 



--

R. Dennis Kelly


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Find the date of the newest file????

2005-06-20 Thread Dennis Kelly
On robust file systems - where there are explicit creation and modify 
dates (e.g. not FATnn), the creation of a new file in a directory (or 
delete or rename, etc.) represents a modify to the directory itself. 
Therefore, the newest file date in such a directory should be the 
modify date of the directory. (Actually, considering deletes, renames, 
etc. - should not be newer than the modify date of the directory.)

Hope this helps.

Charles Maier wrote:


I have a Perl app that catalogs photo files. IS there a quicker way of
finding the newest file date in a directory other than doing a stat on
each file in it??  How??

TIA
Chuck

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


 




___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Prevent Loading from Cache in Internet Explorer

2005-06-19 Thread Dennis Kelly

Perhaps a little follow up wisdom.
Caching can happen anywhere between the origin server and the browser, 
so the browser specific solution might not meet all conditions.
RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1 
http://www.faqs.org/rfcs/rfc2616.html is very explicit about caching. 
Search the contents for the phrase no-cache for a strong discussion. 
(RFC's are frequently legible if you read with the right attitude.)


Bottom line from the RFC is that you put in a line which reads:

Cache-Control: no-cache

(mind the space) in the HTTP Header - Note that this is NOT the HEAD 
... /HEAD section of your html, but in the actual header of the file 
going back (the Reply header described in section 6 of the RFC). Among 
other things, that header declares things like Content-Type. Perhaps 
the Pragma ../Pragma statements described below were intended to be in 
front of the HEAD .../HEAD statements. You are free to experiment, of 
course.


From my experience, when I put the Cache-Control directive in the 
stream, everybody behaved the way I wanted them to.


Microsoft's IIS at version 4 included a tab called HTTP Headers which 
permitted the addition of  a custom header whose name was 
Cache-Control, and whose value was no-cache. This was to accommodate 
folks who read RFC's and want to do things that Microsoft hadn't yet 
figured out a more Microsoft way to do.


Jerry Kassebaum wrote:


Thank you!

It wasn't easy, but the answer was there!

I'll give the full explanation if anyone wants it, but here is the 
short one. The CGI and JavaScript files were updating, but not the two 
*.js files with the chapter and verse! So I eliminated them and put 
the info in the JavaScript file.


The reason I want to use the CGI/Perl file is that there are about 600 
verses the program picks from, and I don't want to have to send all 
that to the player.


The working version is now http://biblescramble.com/ezo7.cgi.

THANK YOU SO MUCH! That was a tuff one!

#

You said:

This article discusses some no-cache bugs in IE and a workaround.
http://www.htmlgoodies.com/beyond/reference/article.php/3472881  And
since u
have the verse in a javascript file, what u really want is the
javascript
file to be reloaded, not just the html page.  I don't know if a browser
expects .js files to change with a page reload.

But looking at what ur trying to do, I don't know why ur trying to do it
this way.  The easy was is to just load all the verses and hints into
one
javascript array and have the play again button just pick a random
number in
that range and update the page elements.  U could do this with no perl
at
all. You're really making a DHTML app.






--


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs





___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs