Link to home
Start Free TrialLog in
Avatar of Frank Freese
Frank FreeseFlag for United States of America

asked on

Embed selected cells into a user form

Folks,
I have attached a workbook with a worksheet that I would like to embed into a form but only the cells with data. Any ideas?
Book1.xlsm
Avatar of Harry Lee
Harry Lee
Flag of Canada image

You have to install Office Web Component 11 to do that. OWC11 was supposed to be used with Office 2003 but it works fine in 32-bit Office 2007. I have not try it with Office 2010 yet.

Once OWC11 is installed, in the VBA Editor, go to Tools -> References. Make sure Microsoft Office Web Components is enabled.

On the user form, right-click on the Controls Toolbox, and select Additional Controls. Scroll down to enable Microsoft Office Spreadsheet.

You should now be able to embed Spreadsheet in user forms.
Avatar of Frank Freese

ASKER

This might be too much of Excel for my users. It's a great control though.
Here's what I was looking for. A control or some VBA that would allow me to embed into a user form the contents (Range XX:YY) ,without the gridlines, from a worksheet.  This does not mean the Web Control won't do this because I've not worked with it before.
Let's see if others have another option for me.
Folks,
My research showed that Office Web Component 11 has to be installed on each machine to work. If that's the case then I will need a different option(s).
I tried capturing what I wanted from Excel as a jpg file and embedding it into a text control but it really looks "bad".
What I'm asking may not be possible. If that's the case then I could simply hyperlink to another worksheet in the workbook where the information resides.
I thank all for you're consideration and input, as always.
Joop.
The multicolumn listbox is worth investigating, however, the formatting is very important part to make the user better understand. Loosing that would confuse them. You can look at the embeeded file I included in this thread to see what I mean.
If there was just a control that allowed one to copy and paste into the control on the user form without loosing formatting with scroll bars would be great.  
There may not be such a control - I'm looking for one though, or VBA.
ASKER CERTIFIED SOLUTION
Avatar of Harry Lee
Harry Lee
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
HarryHYLee,
Stupid me!!!!!! I forgot about the frame.....this will work.
I really appreciate you hanging in there with me!
Thanks - points well earned.
perfect - great job!
HarryHYLee,
By the way, what did you use to capture the image?
1) What I did was change the column width, and row height of the columns and rows around the area you want to show.

2) Set border for better looking, Then, select the area that surround the info you want to show. (Make sure you select one row above and one column left of the area you want to capture the borders.

3) Copy using Ctrl-C. Open up a photo editor (I used Paint). Enlarge the picture so that the whole copied area can show properly on the picture. Paste the clipboard into onto the image.

4) Save it as JPEG.

5) Go back to Excel and use VBA Editor to create a UserForm. Again, make sure the UserForm is big enough. Insert a Frame. Enlarge the frame to at least the width of the image + space for a vertical scroll bar.

6) Insert Picture inside the frame, and insert a scroll bar inside the frame.

7) Finally, setup code of the scroll bar to scroll the image inside the frame.
thanks for the follow-up
have a safe weekend