Skip to content

Instantly share code, notes, and snippets.

@vbcupu
Last active February 11, 2019 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vbcupu/9ff2f1a7ef62f5b733b7a2d4c79a76c9 to your computer and use it in GitHub Desktop.
Save vbcupu/9ff2f1a7ef62f5b733b7a2d4c79a76c9 to your computer and use it in GitHub Desktop.
convert flexgrid ke excel di visual basic 6
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