View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Spiggy Topes Spiggy Topes is offline
external usenet poster
 
Posts: 22
Default Quick Method to Find Chart Sheets?

I work in an area that generates a lot of workbooks containing a lot
of charts spread over a lot of directories. Many are variations on a
theme, and it becomes difficult to find just the chart you need.

So I'm putting together a userform to allow the user to navigate to a
directory, then run through their selection looking for all Excel
workbooks with charts and post them to a listbox, so that a
doubleclick will either open the chart sheet or take a snapshot to the
clipboard. Right now, I'm working on Chart sheets only, avoiding the
issue of embedded charts. That's for dessert.

With a host of API calls to handle directory selection, form
minimization and so forth, it works quite nicely. The only problem I
have is speed. I've done what I can; I look only for files named
*.xls; I look for files longer than 10K - anything shorter just
doesn't have the room for a chart; I look for a standard nine-byte
signature at the start of the file using Open xxx for Binary Access
Read as 1. All of these help to reduce search time, as they don't
involve loading the whole file.

I thought I could find chart sheets by continuing to read in search of
the string "Chart1"; most of the time it works, but not all. I'f
prefer this to work 100% of the time, not just 95%.

Does anyone know of a "signature" string that would reliably identify
a workbook with Chart sheets without opening in Excel? First useful
answer gets a copy of the finished product. Well, actually, if anyone
wants, just ask; but I'd prefer to fix this first...