I found the below code which saves a picture to my desktop but I would like to change the path so that it saves to a SharePoint drive location. Just wondering how you would write the path code for this differently as the path is typically an https:// file extension. Thanks for the help!
VBA Code:
Sub CopyRangeToJpeg()
Dim aChart As Chart, Rng As Range, Path As String
Path = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\" & "Capture.jpg"
Set Rng = Sheets("TABLE").Range("C2:G57")
Call Rng.CopyPicture(xlScreen, xlPicture)
With Sheets.Add
.Shapes.AddChart
.Activate
.Shapes.Item(1).Select
Set aChart = ActiveChart
.Shapes.Item(1).Line.Visible = msoFalse
.Shapes.Item(1).Width = Rng.Width
.Shapes.Item(1).Height = Rng.Height
aChart.Paste
aChart.Export (Path)
Application.DisplayAlerts = False
.Delete
Application.DisplayAlerts = True
End With
MsgBox "Saved to " & vbCr & Path, vbInformation, ""
End Sub
Last edited by a moderator: