chart or graph on VBA userform

Emjaye

Board Regular
Joined
Oct 3, 2003
Messages
89
Hi

Is it possible to have a chart or graph appear on a VBA userform, dynamically updated with it's source data on a hidden worksheet?

I've tried inserting a microsoft chart onto a form but it seems to be different from an excel chart, and I cannot get it to take data off a worksheet.

Using Excel 11.

thanks

Mike
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Thanks Peter,

May go for this as a last resort... no offence :)

I was hoping to do it "literally" not by creating and pasting a GIF onto the form

Mike
 
Upvote 0
Before you dismiss the suggestion out of hand, try it. You may not notice the difference between a quickly changing image and a live chart.

You don't have to copy and paste the chart, either. It is exported as a gif file, which the image control is linked to.
 
Upvote 0
Thank you Jon.
Peter - apologies if I was somewhat hasty in dismissing the idea.

The problem is that the workbook will hold personal data of up to 43 people at each site, with different access and view "rights" controlled by a vba / password log in form.

Creating a gif of a chart of an individual creates it on the computer system as a stand-alone graphic, which would normally get left in existance after excel has been closed.
Thinking about it now, if I create the GIF when chart is updated, place it into the form, and kill the GIF via VBA when the form gets shut down, that should, hopefully, solve that problem. With luck, the end user will never realise the GIF exists int he first place :)

thanks for your replies guys, got me thinking more. again, apologies if I seemed ungrateful

Mike
 
Upvote 0
A more complicated alternative that negates the privacy issue is to use Stephen Bullen's PastePicture approach: copy the chart as a picture, then use his routine to place the image into the form.

The example is about 2/3 of the way down this page:

http://www.oaltd.co.uk/Excel/SBXLPage.asp
 
Upvote 0

Forum statistics

Threads
1,215,313
Messages
6,124,201
Members
449,147
Latest member
sweetkt327

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top