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

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
 
M

Mohamoss

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
 
R

Rock Chiu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top