Buster said:
I'll try and be more clear. . . . .how do I reference the cell in the
spreadsheet that holds the vallue for rate in the equation "cost =work*rate"
I know I can open the sheet through vba, make it active and locate the cell,
but I'd like to be able to reference the ceell without opening the
spreadsheet. Also the sheet is located on a network drive, so i need some
way of making reference to it without hardcoding the drive letter since
other people use different drive letters for the same shared drive.
Jeff
Jeff,
Your question sounds like it is better suited for the Excel vba
newsgroup. Although I have done a considerable amount of VBA between
Project and Excel, I have never needed to reference an Excel formula, if
that's what you are trying to do. I would have to look in the Excel VBA
help file for an answer but then that's something you can do yourself.
And it is still not clear what you are trying to do. Are you in a
Project VBA macro and trying to extract data from a cell in the Excel
without having Excel open? It may be possible but I don't know how to do
it.
If I were writing a macro to be used by different people who may use
different drive letters for a shared drive, I would probably have the
code open Excel and then get the data from the spreadsheet. The
GetObject Method comes to mind. If it is just a piece of data that is
needed, there is no reason to have Excel be visible. Just open (in the
background), extract and close. But I gotta question why people in the
same corporate environment do not have a standard convention for
assigning shared drives. Sounds like a great way to make something
unnecessarily complex and confusing. A set of basic rules can go a long
way in fostering efficiency.
John