Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro - Date format Setting

The date format inside a tabulation is 'DD-MMM-YYYY' but when I export it via Macro, the output which i get is 'D-MMM-YY'.

Is there a way to resolve this.

5 Replies
amit_saini
Master III
Master III

Hi Sonia,

Could you plz share your application.

Thanks,

AS

omyahamburg
Creator II
Creator II

Hello Sonia

Have you tried in your macro something like

Set curSheet = objExcelWorkbook.WorkSheets(1)

curSheet.Range("A1").NumberFormatLocal = "dd/mm/yyyy" ?

best regards

Joerg

Not applicable
Author

 

sub test

set XLApp = CreateObject("Excel.Application")
set XLDoc = XLApp.Workbooks.Add
ActiveDocument.GetSheetObject("CH65").CopyTableToClipboard true
XLDoc.Sheets(1).Paste()
XLDoc.Sheets(1).Range("A1").Select
XLApp.Visible = true

end sub

this is the code which exports my tabulation into an excel. but i get a wrong date format when i do this.

Not applicable
Author

Hi Jorg,

I have tried it out into my application, but I am not able to get the desired result.

Any more help on this.?

omyahamburg
Creator II
Creator II


Hi Sonia

Could you upload a sample app. This makes it easier.