View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default Using Excel Library

"dp" wrote in message
...
It works fine, except I would like to do some formatting like underlines
and
bold and unfortunately I am getting application defined errors.

xlc.TextEffect.FontBold = True


The reason this fails is because it's not a valid construct in the Excel
object model.

I have not included the Excel 11 library in the reference, I am sure there
is where the goodies are, however, I am affaid if the user has a lower
version of Office what will occur, will it throw an error.


You are correct about this. What you should do is develop your
application with a reference set to the Excel object library and all of your
variables declared with the correct Excel object types. That way you can
"see" what you are doing in the Excel object model. Once you're sure it all
works and you're ready to deploy it, remove the Excel reference and change
all the Excel-specific object variable declarations to "As Object".

Keep in mind there have been new features added to the object model in
each version of Excel, so things you can do in Excel 2003 will not always
work in earlier versions of Excel. Unfortunately, there aren't any good
resources to determine what is new and what isn't, so your best bet is to
find a machine with the earliest version of Excel you expect your
application to run on and test it there.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm