Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Excel Library
Hi everyone:
I am tring to develop a product in MS Access. I have a query that uses VBA programing to open an excel sheet and export data to it. 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 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. I have just called my objects in VBA like this to make it simple Set xlx = CreateObject("Excel.Application") Does anybody have any experience with this? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Excel Library
There is an example of Rob' suggestion at
http://www.xldynamic.com/source/xld.EarlyLate.html. It refers to Outlook, but the principle is the same. -- HTH Bob Phillips "Rob Bovey" wrote in message ... "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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Excel Library
Hi Rob:
Thanks for your response. I did try your suggestion. Its really cool to see all those object and functions. I tried to do a border around a range Dim rng As Excel.Range rng.BorderAround 1, -4138 I got the values by using the intermediate window changed the xlmedium to those values, etc removed the xls library changed dim rng as object Thanks, I dont have a lower version of excel to test it on now. Hmm "Rob Bovey" wrote: "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Library in Excel | Excel Discussion (Misc queries) | |||
Excel Library not registered. | Excel Discussion (Misc queries) | |||
Excel 11.0 Object Library | Excel Programming | |||
Reference Library - Missing Library in a lower version. | Excel Programming | |||
Excel Library | Excel Programming |