Hello-- I have the attached code that's working fine on my computer but for some reason is crashing on someone else's w/ a "Type Mismatch" error at the "Set PicTemp = Selection" line... why would this be?
Public Sub GenerateGIF(sheet1, range1, control1, DataRange)
Const FName As String = [directory is here]\temp.gif"
Dim pic_rng As Range
Dim ShTemp As Worksheet
Dim ChTemp As Chart
Dim PicTemp As Picture
Application.ScreenUpdating = False
Set pic_rng = Worksheets(sheet1).Range(range1)
Set ShTemp = Worksheets.Add
ActiveChart.Location Where:=xlLocationAsObject, Name:=ShTemp.Name
ActiveSheet.Shapes("Chart 1").ScaleWidth 8, msoFalse, _
ActiveSheet.Shapes("Chart 1").ScaleHeight 2, msoFalse, _
Set ChTemp = ActiveChart
pic_rng.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Set PicTemp = Selection