LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Excel Properties() collection

I've developed a solution that Exports Crystal reports to Excel, then
formats Excel with a few additional things after the export that
Crystal has a hard time doing (e.g. FreezePanes, WrapText, etc).

All is well, except that any additional tweaks that the end user wants
to the Excel file requires a recompile of my code every time. The
reason - No collection in Excel is accessible with a .Properties()
collection. For instance, I cannot do this for a range collection:

ExcelApp.Worksheets("Sheet1").Range("B5:B12").Prop erties("WrapText") =
True

Instead, I have to do this for every property of the range collection:
ExcelApp.Worksheets("Sheet1").Range("B5:B12").Wrap Text = True

The alternative is ugly - Create a wrapper class for each Excel class
that I want to use, and give it accessible properties for every
property in advance. That's a huge set of wrappers that I want to
avoid, and I want to avoid a recompile for a simple addition like
"Range(strRange).Columns.AutoFit". I'd much rather be able to write
something similar to
"Range(strRange").Properties("Columns").Properties ("AutoFit") = True

So, my question is this: Is there a way to do this, from an external
program automating Excel through COM, that I cannot seem to find?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection Look Up - By Key in an Excel VBA App. vmegha Excel Programming 3 January 19th 06 03:00 PM
Properties transferring from excel cells to word file properties lubo Excel Programming 4 July 12th 05 11:24 AM
Automation Error(-2147467259) in Properties Collection Bob Phillips[_6_] Excel Programming 1 April 14th 05 07:08 PM
Automation Error(-2147467259) in Properties Collection Bob Phillips[_6_] Excel Programming 0 April 14th 05 04:27 PM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"