Click here to Skip to main content
16,005,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to monitor the ctrl+z event in a word document Pin
vb_firstTimer27-Mar-08 0:07
vb_firstTimer27-Mar-08 0:07 
GeneralSize of Flash File descreses Pin
sjs4u26-Mar-08 21:55
sjs4u26-Mar-08 21:55 
GeneralRe: Size of Flash File descreses Pin
Christian Graus26-Mar-08 22:01
protectorChristian Graus26-Mar-08 22:01 
GeneralDatabase update Pin
nitin_ion26-Mar-08 21:26
nitin_ion26-Mar-08 21:26 
GeneralRe: Database update Pin
Dave Kreskowiak28-Mar-08 4:11
mveDave Kreskowiak28-Mar-08 4:11 
GeneralRemoving mouse scroll from adobe acrobat 7.0 browser Pin
Prakash_Mishra26-Mar-08 21:18
Prakash_Mishra26-Mar-08 21:18 
GeneralRe: Removing mouse scroll from adobe acrobat 7.0 browser Pin
Dave Kreskowiak28-Mar-08 4:03
mveDave Kreskowiak28-Mar-08 4:03 
GeneralDate Formating getting changed when Converting MSFlexgrid content to Excel Pin
aaraaayen26-Mar-08 20:29
aaraaayen26-Mar-08 20:29 
Hi All,

In my vb application, I am generating data from database and retriving it and placing it in MSFlexgrid which includes date column also.

And I am using the following code to convert the data from MSFlexgrid to Excel.

But in that, in Date column is in properly coming in MSFlexgrid. But when we convert it to Excel, some of the dates (like 12/03/2008, 11/03/2008,04/03,2008..I hope all the dates less than or equal to 12) will be converted like 03/12/2008, 03/04/2008, 03/11/2008...like this. But the other dates 25/03/2008...is populating in Excel correctly.

Please help me how to overcome this issue.

Dim xlObject As Excel.Application
Dim xlWB As Excel.Workbook
Set xlObject = New Excel.Application 'This Adds a new woorkbook, you could open the workbook from file also
Set xlWB = xlObject.Workbooks.Add
Clipboard.Clear 'Clear the Clipboard
With MSFlexGrid1 'Select Full Contents (You could also select partial content)
.Col = 0 'From first column
.Row = 0 'From first Row (header)
.ColSel = .Cols - 1 'Select all columns
.RowSel = .Rows - 1 'Select all rows
Clipboard.SetText .Clip 'Send to Clipboard
End With

With xlObject.ActiveWorkbook.ActiveSheet

.Range("b2").Select 'Select Cell A1 (will paste from here, to different cells)
.Paste 'Paste clipboard contents
End With ' This makes Excel visible
xlObject.Visible = True


Thanks in Advance,

Regards,
R. Sangeetha Priya
GeneralRe: Date Formating getting changed when Converting MSFlexgrid content to Excel Pin
Prakash_Mishra26-Mar-08 21:41
Prakash_Mishra26-Mar-08 21:41 
GeneralRe: Date Formating getting changed when Converting MSFlexgrid content to Excel Pin
aaraaayen26-Mar-08 21:54
aaraaayen26-Mar-08 21:54 
GeneralRe: Date Formating getting changed when Converting MSFlexgrid content to Excel Pin
Ashfield26-Mar-08 22:04
Ashfield26-Mar-08 22:04 
GeneralRe: Date Formating getting changed when Converting MSFlexgrid content to Excel Pin
Prakash_Mishra26-Mar-08 23:16
Prakash_Mishra26-Mar-08 23:16 
GeneralInvalid attempt to Read when reader is closed Pin
sjs4u26-Mar-08 20:03
sjs4u26-Mar-08 20:03 
GeneralRe: Invalid attempt to Read when reader is closed Pin
Dave Kreskowiak28-Mar-08 3:46
mveDave Kreskowiak28-Mar-08 3:46 
GeneralDeleting the Data... Pin
phowarso26-Mar-08 17:07
phowarso26-Mar-08 17:07 
GeneralRe: Deleting the Data... Pin
Christian Graus26-Mar-08 17:52
protectorChristian Graus26-Mar-08 17:52 
GeneralAdding System.IO.Ports to VB '03 Pin
loganj199926-Mar-08 16:33
loganj199926-Mar-08 16:33 
GeneralRe: Adding System.IO.Ports to VB '03 Pin
Christian Graus26-Mar-08 17:54
protectorChristian Graus26-Mar-08 17:54 
GeneralRe: Adding System.IO.Ports to VB '03 Pin
loganj199927-Mar-08 0:57
loganj199927-Mar-08 0:57 
GeneralRe: Adding System.IO.Ports to VB '03 Pin
Dave Kreskowiak27-Mar-08 1:35
mveDave Kreskowiak27-Mar-08 1:35 
GeneralRe: Adding System.IO.Ports to VB '03 Pin
loganj199927-Mar-08 5:23
loganj199927-Mar-08 5:23 
GeneralDumb question Pin
cstrader23226-Mar-08 13:40
cstrader23226-Mar-08 13:40 
GeneralRe: Dumb question Pin
Christian Graus26-Mar-08 14:02
protectorChristian Graus26-Mar-08 14:02 
GeneralRe: Dumb question Pin
cstrader23226-Mar-08 15:34
cstrader23226-Mar-08 15:34 
GeneralRe: Dumb question Pin
cstrader23226-Mar-08 15:38
cstrader23226-Mar-08 15:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.