unbound object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
i am trying to add an unbound object (OLE Type: linked). It is an excel
file: mydoc.xls.
It seems that the link shows only the sheet that was last saved in Excel.

Say, if i have sheet_A & sheet_Bin mydoc.xls.
If i save sheet_A, then sheet_A is shown in the report.
If i re-open mydoc.xls and i save sheet_B, then sheet_B is shown....

How can i reference a certain sheet (say: sheetA), whtever i save in Excel??!
Thanx in advance...
 
you need to create a reference to an excel object, and
then make references to each sheet.

do something like this:

Dim xlapp as Object
Dim xlbook as Object
Dim xlsheetA as Object
Dim xlsheetB as Object

Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Open(*Path and Filename here*)
Set xlsheetA = xlapp.Worksheets("sheet_A")
Set xlsheetB = xlapp.Worksheets("sheet_B")

you should then be able to choose which sheet you show in
your unbound OLE object by using the xlsheetA or xlsheetB
references you've just created.

i hope this helps!
 
hi rob, thx for the info. however, the excel sheet already exists and the
thing is i don't know wht is code to reference unbound OLE object ! where
should i put the reference to the excel sheet and the excel file.
thx. appreciate it
 
Back
Top