PC Review


Reply
Thread Tools Rate Thread

Date formattting in Excel when using OLE

 
 
jodleren
Guest
Posts: n/a
 
      30th Mar 2007
Hi all!

I work with OLE, and want to do this:

somecell.value = some date (which i have in mm.dd.yyyy format
numberformat = "yyyy" // year only
nextcell.value = previous cell
numberformat = "mmm" // month as name

I have tried this, but it does not work:

$WB->Sheets(1)->Cells($excel_index,1)->NumberFormat="mm.dd.yyyy";
$WB->Sheets(1)->Cells($excel_index,1)-
>Value=GetMyDateFormat(odbc_result($result,3));

$WB->Sheets(1)->Cells($excel_index,1)->NumberFormat="yyyy";
$WB->Sheets(1)->Cells($excel_index,2)->NumberFormat="mm.dd.yyyy";
$WB->Sheets(1)->Cells($excel_index,2)-
>Value=GetMyDateFormat(odbc_result($result,3));

$WB->Sheets(1)->Cells($excel_index,2)->NumberFormat="mmm";

GetMyDateFormat returns the date in "mm.dd.yyyy" format.

Is there an Excel guru here?

Eventually I'd like to add a date and format it as yyyy/mm

BR
Sonnich

 
Reply With Quote
 
 
 
 
jodleren
Guest
Posts: n/a
 
      11th Apr 2007
I repost this in hope of just getting any answer....

also, how come, that the format #0.00 only works sometimes?
It should be the same always

On Mar 30, 3:56 pm, "jodleren" <sonn...@hot.ee> wrote:
> Hi all!
>
> I work with OLE, and want to do this:
>
> somecell.value = some date (which i have in mm.dd.yyyy format
> numberformat = "yyyy" // year only
> nextcell.value = previous cell
> numberformat = "mmm" // month as name
>
> I have tried this, but it does not work:
>
> $WB->Sheets(1)->Cells($excel_index,1)->NumberFormat="mm.dd.yyyy";
> $WB->Sheets(1)->Cells($excel_index,1)->Value=GetMyDateFormat(odbc_result($result,3));
>
> $WB->Sheets(1)->Cells($excel_index,1)->NumberFormat="yyyy";
> $WB->Sheets(1)->Cells($excel_index,2)->NumberFormat="mm.dd.yyyy";
> $WB->Sheets(1)->Cells($excel_index,2)->Value=GetMyDateFormat(odbc_result($result,3));
>
> $WB->Sheets(1)->Cells($excel_index,2)->NumberFormat="mmm";
>
> GetMyDateFormat returns the date in "mm.dd.yyyy" format.
>
> Is there an Excel guru here?
>
> Eventually I'd like to add a date and format it as yyyy/mm
>
> BRSonnich



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formattting kaci Microsoft Excel Misc 5 6th May 2009 01:15 PM
Formattting Text =?Utf-8?B?RG9ub3Zhbg==?= Microsoft Excel Worksheet Functions 1 6th Jun 2007 03:41 PM
Formattting Fractions =?Utf-8?B?TWFydGhhU3Vl?= Microsoft Excel Misc 3 2nd May 2005 06:54 AM
Conditional Formattting =?Utf-8?B?U3RldmU=?= Microsoft Excel Misc 3 5th Apr 2004 03:44 PM
formattting numerics Brent Burkart Microsoft VB .NET 3 22nd Oct 2003 02:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:18 PM.