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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refrehing Li nked OLE Object(s)

Status
Not open for further replies.

Steve101

Programmer
Mar 29, 2002
1,473
AU
I have two Excel charts embedded on a form. I use code to create the charts on a spreadsheet, then, via a table which contains the links to the embedded objects, display the charts on the form.

The code is as follows:

1) GenerateChart "1,2", SF!txtWorkBook
2) X = CopyFile(SF!txtWorkBook, SF!txtResultsWorkbook, False)

3) Application.Echo False
4) SF!OLEChart1.ControlSource = "OLEChart1"
5) SF!OLEChart1.Visible = True
6) SF!OLEChart1.SetFocus

7) SF!OLEChart2.ControlSource = "OLEChart2"
8) SF!OLEChart2.Visible = True
9) SF!OLEChart2.SetFocus
10) Application.Echo True

Line 1 is my procedure for generating the charts on a fixed name spreadsheet which the program works with.
Line 2 copies the spreadsheet to a second, user defined spreadsheet.

Lines 4-6 and 7-9 is where the Charts are made visible on the form via linking to the fields on the table to which the form is bound.

The 2nd OLE control refreshes correctly (ie. the one ending up with the focus). The first will not refresh its contents until I physically click on it.

Here are my questions:

(a) How do I get all bound OLE controls to guarentee refresh to their underlying objects?

(b) I'd be quite happy to do away with the intermediate table objects, and make the charts unbound links. Any simple examples on how to do this would be appreciated.

Thanks in advance,
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top