View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default 3d range names/references

Where is the error?

What does vWorkbookPath hold?

What does sWorkheet hold?

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"alfaista" wrote in message
...
i hope this is the correct place to ask this question.

i am accessing an Excel workbook from Access. i need to be able to get
the
value of a cell that has a 3d type of name/reference, i.e.
Sheet1:Sheet2!$E$2
= MyName.
i need it named like this because i will need the value off one of those
two
worksheets, based on which one the user needs.

here is some of my code...
Dim xlApplication As Excel.Application
Dim xlWorkbook As Excel.Workbook
Dim xlWorksheet As Excel.Worksheet

Set xlApplication = CreateObject("Excel.Application")
Set xlWorkbook = GetObject(vWorkbookPath)

xlWorkbook.Worksheets(sWorkSheet).Activate

vAns = xlWorkbook.ActiveSheet.Range(sName)

well, it doesn't work. says Application defined or Object defined error.
is it possible to do what i am trying to do?
if not, does anyone have any other ideas? i would prefer to not have
MyName1, MyName2, etc....for all these identical cells on different
worksheets.

thanks in advance for any help!