Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Dim xlApp As excel.Application
  2. Set xlApp = New excel.Application
  3. Dim xlWkb As excel.Workbook
  4. Set xlWkb = xlApp.Workbooks.Open("D:DocumentsBook1.xlsx")
  5. Dim xlSht As excel.Worksheet
  6. Set xlSht = xlWkb.Worksheets(1)
  7. Dim xlChart As excel.Chart
  8. Set xlChart = xlWkb.Charts.Add
  9. xlChart.ChartType = xlLine
  10. xlChart.SetSourceData xlSht.Range("A1:B5"), xlColumns
  11. xlChart.Visible = xlSheetVisible
  12. xlChart.Legend.Clear
  13. xlChart.ChartArea.Font.Size = 15
  14. xlChart.ChartArea.Font.Color = vbRed
  15. xlChart.ChartArea.Select
  16. xlChart.ChartArea.Copy
  17. Image1.Picture = Clipboard.GetData(vbCFBitmap) ' Image1 is an image control already placed on the Form.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement