suoirotciv -
If you don't know 100% what version of Excel, Office, Word, etc that the users have installed, then using a reference will cause problems, so yes, go ahead and remove the reference. You would then use late binding via the CreateObject call.
If you look in your registry, you'll see that there's a version-independent key in there, and it can tell you what the latest version installed is. On my home machine, I have:
[ignore]
Excel.Sheet
|
+ CLSID
|
+ CurVer
|
+ Shell
[/ignore]
The value for CurVer is "Excel.Sheet.8". I can use this value in my call to CreateObject.
Sometimes you have to go via this indirect route. Different versions of Excel return different object types from this call. See:
Basically, Excel 97 returns a "Workbook" object and Excel 5.0, 7.0 return a "Worksheet" object. So you have handle things differently depending on the version of Excel they have installed (which the first registry call told you).
Chip H.
____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first