By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

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

P: n/a

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("us**",
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.
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
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
Nov 15 '05 #2

P: n/a

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...


*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.