LoadPicture workaround for Excel 2011 VBA for Mac

  • Thread starter Thread starter Drew
  • Start date Start date
D

Drew

Hi
After many hours of experimenting myself and reading Ron DeBruin's
website, I have a possible workaround for LoadPicture, which doesn't
work on the Mac version of Excel. It involves using the following
insert command.

ActiveSheet.Pictures.Insert (PicName & ".jpg")

I can supply more details if you are desperate.
 
Hello, I am having this problem too and am desperately looking for a fix and or workaround for a programming class. This is the applicable part of my code, I'm trying to take a graph that I have plotted on my sheet and uploadit as a gif into a picture box on my user form. Any help would be appreciated,

Thanks,

Kevin

'put valujes in sheet
For i = 0 To N
Cells(i + 1, 1) = t(i)
Cells(i + 1, 2) = y(i)
Next

For i = 1 To ActiveSheet.ChartObjects.Count
ActiveSheet.ChartObjects(1).Delete
Next

'create a new chart
ActiveSheet.ChartObjects.Add(300, 100, 500, 300).Select
ActiveChart.ChartType = xlXYScatter

'plot graph
ActiveChart.SetSourceData Source:=ActiveSheet.Range(Cells(1, 1), Cells(N + 1, 2)), PlotBy:=xlColumns
ActiveChart.Legend.Select
Selection.Delete

'load graph to userform
ActiveChart.Export Filename:="/Users/khulik/Desktop tempchart123123.gif", FilterName:="GIF"
solutionimage.Picture = LoadPicture("/Users/khulik/Desktop tempchart123123.gif")


End Sub
 
Hello,

Can you help me run this code on Excel for Mac (2011)? I have error 1004... On Windows (Office 2010) everything is OK.

Sub Wstaw_Obraz()
Dim target As Range
Dim Pic As Object
Sheets("druk").Select
Set target = Range("H7")


If Range("G7").Value = 1 Then
Set Pic = ActiveSheet.Pictures.Insert("URL")
ElseIf Range("G7").Value = 2 Then
Set Pic = ActiveSheet.Pictures.Insert("URL")
End If

If Not Pic Is Nothing Then
Pic.Top = target.Top
Pic.Left = target.Left
Pic.Width = target.Width ' dopasowuje do wielkosci komorki
Pic.Height = 36 'dopasowuje do wielkosci komorki
End If

End Sub
 
Back
Top