how to convert VBA #date# format to C# code?

  • Thread starter Thread starter Rock
  • Start date Start date
R

Rock

Hi,all:

how to convert VBA #date# format (ex: #2004/3/6#) to C# code ?
here are vba code :
Dim objUserPerm As Office.UserPermission
Set objUserPerm = ActiveWorkbook.Permission.Add("(e-mail address removed)",
msoPermissionRead + msoPermissionEdit, #12/31/2005#) a to c# ??
I don't know how to convert this code to C#? and I have already try
it use DateTime format, but it happen argument error. anyone have the
same problem ? thank you.
Rock
 
Hi Rock
what do you mean by using DateTime Format ...... have you tried to use
this:: System.DateTime.Parse(' put your time here'), this in c# should
parse the sring with in as time .
another way is to do it your self .. get the string and write code to
parse the date...... though the parse method should do it fine
hope that would help
 
Thank you very much, Mohamoss
, I have resolve this problem..

here is my code:

DateTime d = Convert.toDataTime("2004/3/9");

it's work fine.

thank you for your help...

Rock
 
Back
Top