Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy and Paste

Status
Not open for further replies.

GaryPollitt

Programmer
Jun 10, 2002
5
GB
I need to copy a chart from Excel into an Access table. From Access I open Excel recordset and use
ExcelApp.Sheets("Sheet1").Select
ExcelApp.ActiveChart.ChartArea.Select
ExcelApp.ActiveChart.ChartArea.Copy
Now I need to add that to a field in my access tbl but I cannot find a way to paste it into the tbl.
 
eh ???
You are gonna have a TABLE with a chart PICTURE in it..... are you sure ???
Why ???
AFAIK, there is no "Picture" data type you can hold in a table in Access. If you want to reproduce the chart, I would suggest you copy the chart DATA into a table in access and then use that to create a chart in Access
HTH
Geoff
 
Hi Geoff,
Thanks for response.
Cannot do the chart in Access, too much data, excel is the only way. I actually create 3 graphs on 3 separate sheets. I then need to create a report in access that links to these excel sheets.
I have a 3 OLE Object fields in Access and I was hoping to use code to insert these sheets from Excel into the 3 OLE Object fields.
So what I did was open Excel, copy the sheet and try to paste it into the Access fields.
I have even tried using the property Source Doc and Source Item to specify the sheets in Excel, and that does not work
Just cannot link to charts !!!!
 
I don't want to state the obvious but if there is "too much data", surely Access would be the tool. As a general rule, I work in excel until the dataset gets too large and then I upsize to Access.
However, If you really want to do it this way, I found this in Excel"Help"
Drag information between programs

You can move or copy information, or you can create a linked object, a shortcut, or a hyperlink between documents in different programs by using drag-and-drop editing. Both programs must support OLE.

1 Arrange the program windows so that both the source file and the destination file are open and visible. You must be able to see the information you want to drag as well as the location where you want to drop it.
2 Select the information, and then use the right mouse button to drag the selection to the new location in the other program.
3 On the shortcut menu, click the command you want.

Tip To prevent scrolling when you drag information, drag quickly to the other program window, or hold down ALT as you drag.

ie Have excel as a 1/2 window and access as a 1/2 window. Open your table that you want to paste to and drag the chart (with the right mouse button) into the cell in the table that you want. Tried it and it works for me. Very manual but you only have 3 charts and as far as I can see, they stay linked so that if you change the chart in excel, it updates in Access

ps. Thanks for teaching me something new - didn't realise you could have "picture" fields in Access

HTH
Geoff
 
Thanks Geoff
When I mean "too much" data I meant for Graphing. Even though Access and Excel use the same! graphing program (I'am told). I have too much data to graph in Access, so I graph in Excel then wanted to view these graphs in an Access Report. But I need to Insert the Excel Sheet into my Access table automatically...... Still working on it!!
Cannot do it manually because I have over 1000 excel spreadsheets (each week!!) with 4 graphs in each.
Gary
 
Here's an idea - don't know if it'd work but.....could you insert an embedded (linked) chart into your report and then dynamically change the link dependant on what you want to see in Access ??
Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top