View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
witek witek is offline
external usenet poster
 
Posts: 147
Default XLL, C++ and dates

joel wrote:
I would think that C++ in windows would use the same libraries as VBA
and store date the same way.
All you shold have todo is over-ride the
varible type and pass the number into a C++ function like MyDay =
day(Date 42345)


C++ does not have Date type.



If this doesn't work then you can use the VBA function like this


obj = excel.application 'not usr eof the exact syntax
obj.application.evaluate("Day(42345)")


or
obj = excel.application 'not usr eof the exact syntax
obj.worksheetfuncttion.Day(42345)


Too slow, and I do not want to link C++ back to Excel. It must be
independent. The interaction is done using XLOPER




YOu are going to have to give the user an option box to choose either a
number of a date.


It does not work.
User can paste data in any way or mixing them.


Or have the user enter the date in mm/dd/yy format

Date can be entered in any local format used. It used globally around
the World. So I can't assume any date format. Excel does that
interpretation form based on local settings.


and tthen search for the forward slash in the string. If you havve the
forward slash it would be a date otherwise a number.

I don't have access to date entered as string.
The only way Excel passes information to XLL function is integer
representing date.