Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format statement no longer throws an error

I had code running in Excel 97 that would throw an error, but now that I am running Excel 2003 it does not.

Format$("0.5","General"

It used to throw error 5 (Invalid procedure call or argument), but now it returns "Ge5eral". Is this a documented change?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Format statement no longer throws an error

You're mixing Worksheet NumberFormat expression with VBA format.

It's interpretting the N in "General" as a minute (hh:nn:ss)

If you want to format a cell as General:
ActiveCell.NumberFormat = "General"


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"PF" wrote in message
...
I had code running in Excel 97 that would throw an error, but now that I

am running Excel 2003 it does not.

Format$("0.5","General")

It used to throw error 5 (Invalid procedure call or argument), but now it

returns "Ge5eral". Is this a documented change?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Format statement no longer throws an error

Try:

Format$(0.5, "General Number")

(not sure why you had "0.5" in double quotes, either.)

PF wrote:

I had code running in Excel 97 that would throw an error, but now that I am running Excel 2003 it does not.

Format$("0.5","General")

It used to throw error 5 (Invalid procedure call or argument), but now it returns "Ge5eral". Is this a documented change?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Format statement no longer throws an error

Hi,

Thanks for posting in the community!

I agree with Rob and Dave. If you have any other questoins, please feel free to let me know.

Enjoy a nice weekend!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Format statement no longer throws an error

That's all interesting information, but it didn't really
answer my question, which is why does this statement not
throw an error while it did in previous versions.
-----Original Message-----
Hi,

Thanks for posting in the community!

I agree with Rob and Dave. If you have any other

questoins, please feel free to let me know.

Enjoy a nice weekend!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and

confers no rights.


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Format statement no longer throws an error

Hi PF,

Thank you for replying!

Currentlly we are performing some research on this problem, and we will reply you ASAP if we get any results!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Format statement no longer throws an error


Hi,

It sure looks like the string "General" is being interpreted as a format
string and that your value is being inserted at the "n" position. I will
have to investigate if the behavior Format in Excel 2003 has changed. I'll
post another reply as soon as I have finished investigating.

Thanks for your patience.

Thanks,

Jim

Jim Vita
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can no longer format values in pivot table ChuckW Excel Discussion (Misc queries) 4 December 5th 08 09:11 PM
excel can no longer recognise format mdavis27 Excel Discussion (Misc queries) 0 July 2nd 06 10:48 PM
Accounting format now no longer display negative figures in ( )'s R. Earl R. Excel Discussion (Misc queries) 2 October 16th 05 09:56 PM
After grouping & ungrouping a chart, I can no longer format it? Pro_D Mike Charts and Charting in Excel 0 October 5th 05 08:01 PM
[Q] Save As throws type mismatch error in control's code? Jason Weiss Excel Discussion (Misc queries) 1 July 16th 05 04:21 AM


All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"