sam314159
10-22-2009, 01:41 PM
I wanted to use an image file as the background for a chart that my VBA script was creating so I used the code below to reference the image file:
ActiveChart.PlotArea.Select
Selection.Fill.UserPicture PictureFile:= _
"T:\Shared\Resources\ChartGround.gif"
This worked great with one shortcoming. It only worked when the user had access to the shared drive and when some external users started using the script they couldn't get the image.
1. Is there any way to actually imbed the image file in the workbook and then reference it like I did above?
2. Can anyone think of a better way for me to do this? I just want my VBA script to use an image as the background to the chart it creates.
ps I have tried other alternatives like sending the image file to every user and just referencing the image relative to the working directory but I don't like having to send the user two files. I would much rather just handle a single file.
Thanks in advance for the help. I hope I didn't miss the solution when I tried searching the forums.
Sam
ActiveChart.PlotArea.Select
Selection.Fill.UserPicture PictureFile:= _
"T:\Shared\Resources\ChartGround.gif"
This worked great with one shortcoming. It only worked when the user had access to the shared drive and when some external users started using the script they couldn't get the image.
1. Is there any way to actually imbed the image file in the workbook and then reference it like I did above?
2. Can anyone think of a better way for me to do this? I just want my VBA script to use an image as the background to the chart it creates.
ps I have tried other alternatives like sending the image file to every user and just referencing the image relative to the working directory but I don't like having to send the user two files. I would much rather just handle a single file.
Thanks in advance for the help. I hope I didn't miss the solution when I tried searching the forums.
Sam