JannetteChristie
Board Regular
- Joined
- Dec 14, 2015
- Messages
- 130
- Office Version
- 365
Hello,
I have the following sheet that when the user saves it then copies to an email but it is cutting off the last few columns.
The VB code I am using is as follows:
The report
When it copies to the email columns S to to V are missing, can anyone advise what I can do to prevent this from happening.
Thanks
I have the following sheet that when the user saves it then copies to an email but it is cutting off the last few columns.
The VB code I am using is as follows:
VBA Code:
Sub CreatePNG(Namesheet As String, nameRange As String, nameFile As String)
'ThisWorkbook.Activate
'Worksheets(Namesheet).Activate
Dim Plage As Range
Set Plage = ThisWorkbook.Worksheets("Report").Range(nameRange)
Plage.CopyPicture
With ThisWorkbook.Worksheets(Namesheet).ChartObjects.Add(Plage.Left, Plage.Top, Plage.Width, Plage.Height)
.Activate
.Chart.Paste
.Chart.Export nameFile, "JPG"
End With
Worksheets(Namesheet).ChartObjects(Worksheets(Namesheet).ChartObjects.Count).Delete
Set Plage = Nothing
Worksheets("Report").Activate
End Sub
The report
When it copies to the email columns S to to V are missing, can anyone advise what I can do to prevent this from happening.
Thanks