Excel VBA Macro: Create Word Document & Copy Paste Chart/Graph/Diagram (from Excel)
💼 Hire Me for Excel VBA Automation Need help automating your Excel workflows? I specialize in building custom Excel VBA solutions to save you time and eliminate repetitive tasks. 👉 https://www.upwork.com/freelancers/~013bd05e311ebf4a2c Excel VBA Macro: Create Word Document & Copy Paste Chart/Graph/Diagram (from Excel). Code: Sub add_chart_2_word() Dim objWord Dim objDoc Dim i As Integer Dim j As Integer Dim ws As Worksheet Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Add Set ws = ThisWorkbook.Sheets("Sheet1") With objDoc .Styles.Add ("Main Title") .Styles.Add ("Sub Title") With .Styles("Main Title").Font .Name = "Calibri" .Size = 30 .Bold = True .Color = RGB(26, 134, 31) End With With .Styles("Sub Title").Font .Name = "Arial" .Size = 15 .Bold = False .Color = RGB(0, 0, 0) End With End With With objWord .Visible = True .Activate With .Selection .Style = objDoc.Styles("Main Title") .typetext ("Country Report") .typeparagraph .Style = objDoc.Styles("Sub Title") .typetext (ws.Cells(8, 1).Text) .typeparagraph ws.ChartObjects("Chart 1").Chart.CopyPicture .Paste .typeparagraph .typetext (ws.Cells(9, 1).Text) .typeparagraph ws.ChartObjects("Chart 2").Chart.CopyPicture .Paste .typeparagraph End With End With End Sub #ExcelVBA #ExcelMacro
Download
0 formatsNo download links available.