Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default excel 2003 Reading workbook properties / details from an XLA how do you do it?

Reading workbook properties from an XLA

Hi,

Hope you can help me on this one.
I have a Software Package that exports excel workbooks containing
worksheets with data in an unformatted state,
I am using excel 2003 and have written a VBA formatting macro which
works fine to format this raw data (colours, borders, applys some
formulas etc)
What i want to do is distribute this macro so that when a user opens
up one of these raw data spreadsheets, if certain criteria are matched
then format it automatically using my macro.

The criteria could be
a) if a custom property exists that we have set (part of the File-
properties-Custom Tab)

or
b) in some instances on export we have no control on the exported
excel file, so there are no custom properties so we must check on
certain worksheet names, cell values to see if they contain specific
data (i.e. column headings - ok not elegant but headings will be very
unique)

Thus what I want to do is do this via an xla file.
So I saved my VBA macro as an XLA
I then added the event Sub auto_open() to the xla code
within this even i added some code to do the criteria checks
I then placed the xla into the following directory

C:\Program Files\Microsoft Office\OFFICE11\XLSTART

Anything placed in here runs whenever excel opens (i.e. i cannot
expect the user to "add in" something manually via addins i want it
automated), therefore what i did was in the on_open event, was to do
my criteria checks however at this point the workbook is not present
i.e. you cannot do activeworkbook. or thisworkbook. as it refers to
the xla not the file i am opening.

Hence whereas the code below to retrieve a custom property will work
in a normal workbook, it wont when in an xla, i need somehow to get a
handle on the workbook i am opening..

On Error Resume Next
Application.ActiveWorkbook.CustomDocumentPropertie s("HasBeenFormatted").Value
On Error Goto 0

--this will fail in an xla, i want it to get the custom properties of
the book i am opening...

Any ideas, appreciated
thanks

Brad

Reply
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
excel 2003 Reading workbook properties / details from an XLA how do you do it? brad Excel Programming 1 September 14th 07 03:48 AM
IE automation, Frames content reading problem, excel 2003 and 2007 Piotr Zaniewski Excel Programming 0 August 29th 07 02:37 PM
No ActiveX controls when reading 2007 file formats into Excel 2003 Tony Excel Discussion (Misc queries) 0 May 30th 07 07:16 PM
2003 Excel isn't reading the book.xlt file on startup. rlweaver007 Excel Discussion (Misc queries) 1 March 15th 05 09:26 AM
Range.Formula in Excel 2003 gives Error reading formulas just below 1024 bytes Frank Jones Excel Programming 14 July 9th 04 06:25 AM


All times are GMT +1. The time now is 11:02 PM.

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"