Last active
February 11, 2019 08:53
-
-
Save vbcupu/9ff2f1a7ef62f5b733b7a2d4c79a76c9 to your computer and use it in GitHub Desktop.
convert flexgrid ke excel di visual basic 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub cmdConvertExcell_Click() | |
''Flex2Excel fgData, "Export of Data" | |
' | |
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 fgData | |
'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("A1").Select 'Select Cell A1 (will paste from here, to different cells) | |
.Paste 'Paste clipboard contents | |
End With | |
' This makes Excel visible | |
xlObject.Visible = True | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment