Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default YAQ (Yet another question)

I found a serious problems with my VBA in a workbook that generates reports.
There is a "Master" workbook, that the users open and then they import
several text files to create the report. They then print that report and
save it. I never thought to remove all the code from workbook before they
saved it. Now I find that if they open one of those reports, all the
information could be wiped out. I have corrected the problem for any new
report they run, but the problem is still stored away in all the old
reports.

I figured out that if I open one of those old reports and simple remove all
the code, then save the file, everything is fine.

So what I have done is build a new report generator, that will build a list
of all the potentially problem files the first time the report generator is
run. I use FileSearch to look for "*.xls" files that contain the specific
sub name. All these files names (with paths) are added to a hidden
worksheet. Then every time the report builder is opened, I plan to correct
several of these problematic files, until they have all been fixed.

I could do this all at once, but the problem is how long it ties up the
user's machine.

Just searching the My Documents folder for problematic files takes over an
hour. And, fixing all of the files at once will take even longer. I tried
just searching for the "*.xls" files and then going back to search those for
the specific sub name but just finding the "*.xls" files takes even longer.

I can not count on the report file names being of a specific format. each
user uses a different naming convention.

Can someone suggest anything faster than this code:

With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.TextOrProperty = "BuildStreetsReports"
.MatchTextExactly = False
.filename = "*.xls"
.Execute


TIA,
Ken



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default YAQ (Yet another question)

Will the XLS files on their machine list you as the Author (Summary Tab) of
File-Properties, and is this something that you can search for using code?

Just a thought.

HTH

Bill
"Ken Loomis" wrote in message
...
I found a serious problems with my VBA in a workbook that generates
reports. There is a "Master" workbook, that the users open and then they
import several text files to create the report. They then print that report
and save it. I never thought to remove all the code from workbook before
they saved it. Now I find that if they open one of those reports, all the
information could be wiped out. I have corrected the problem for any new
report they run, but the problem is still stored away in all the old
reports.

I figured out that if I open one of those old reports and simple remove
all the code, then save the file, everything is fine.

So what I have done is build a new report generator, that will build a
list of all the potentially problem files the first time the report
generator is run. I use FileSearch to look for "*.xls" files that contain
the specific sub name. All these files names (with paths) are added to a
hidden worksheet. Then every time the report builder is opened, I plan to
correct several of these problematic files, until they have all been
fixed.

I could do this all at once, but the problem is how long it ties up the
user's machine.

Just searching the My Documents folder for problematic files takes over an
hour. And, fixing all of the files at once will take even longer. I tried
just searching for the "*.xls" files and then going back to search those
for the specific sub name but just finding the "*.xls" files takes even
longer.

I can not count on the report file names being of a specific format. each
user uses a different naming convention.

Can someone suggest anything faster than this code:

With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.TextOrProperty = "BuildStreetsReports"
.MatchTextExactly = False
.filename = "*.xls"
.Execute


TIA,
Ken





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default YAQ (Yet another question)

I'll try that.

Can you suggest the code to access the author property of a file?

Ken


"William Benson" wrote in message
...
Will the XLS files on their machine list you as the Author (Summary Tab)
of File-Properties, and is this something that you can search for using
code?

Just a thought.

HTH

Bill
"Ken Loomis" wrote in message
...
I found a serious problems with my VBA in a workbook that generates
reports. There is a "Master" workbook, that the users open and then they
import several text files to create the report. They then print that
report and save it. I never thought to remove all the code from workbook
before they saved it. Now I find that if they open one of those reports,
all the information could be wiped out. I have corrected the problem for
any new report they run, but the problem is still stored away in all the
old reports.

I figured out that if I open one of those old reports and simple remove
all the code, then save the file, everything is fine.

So what I have done is build a new report generator, that will build a
list of all the potentially problem files the first time the report
generator is run. I use FileSearch to look for "*.xls" files that contain
the specific sub name. All these files names (with paths) are added to a
hidden worksheet. Then every time the report builder is opened, I plan to
correct several of these problematic files, until they have all been
fixed.

I could do this all at once, but the problem is how long it ties up the
user's machine.

Just searching the My Documents folder for problematic files takes over
an hour. And, fixing all of the files at once will take even longer. I
tried just searching for the "*.xls" files and then going back to search
those for the specific sub name but just finding the "*.xls" files takes
even longer.

I can not count on the report file names being of a specific format. each
user uses a different naming convention.

Can someone suggest anything faster than this code:

With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.TextOrProperty = "BuildStreetsReports"
.MatchTextExactly = False
.filename = "*.xls"
.Execute


TIA,
Ken







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default YAQ (Yet another question)

Ken,

I've never used the FileSearch object, so thanks for opportunity for
education! This seems to work. There doesn't seem to be a unique Author
property (I thought Creator might work but it refers to the creator program,
not person) so TextOrProperty seems to be the way to go. I switched the
exact match field to True. This is not especially quick, it took almost a
minute.

Sub test()
Dim i As Long

With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\Doug\My Documents\"
.SearchSubFolders = True
.MatchTextExactly = True
.Filename = "*.xls"
.TextOrProperty = "Doug Glancy"
.Execute
Debug.Print .FoundFiles.Count
For i = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(i)
Next i
End With
End Sub


hth,

Doug

"Ken Loomis" wrote in message
...
I'll try that.

Can you suggest the code to access the author property of a file?

Ken


"William Benson" wrote in message
...
Will the XLS files on their machine list you as the Author (Summary Tab)
of File-Properties, and is this something that you can search for using
code?

Just a thought.

HTH

Bill
"Ken Loomis" wrote in message
...
I found a serious problems with my VBA in a workbook that generates
reports. There is a "Master" workbook, that the users open and then they
import several text files to create the report. They then print that
report and save it. I never thought to remove all the code from workbook
before they saved it. Now I find that if they open one of those reports,
all the information could be wiped out. I have corrected the problem for
any new report they run, but the problem is still stored away in all the
old reports.

I figured out that if I open one of those old reports and simple remove
all the code, then save the file, everything is fine.

So what I have done is build a new report generator, that will build a
list of all the potentially problem files the first time the report
generator is run. I use FileSearch to look for "*.xls" files that
contain the specific sub name. All these files names (with paths) are
added to a hidden worksheet. Then every time the report builder is
opened, I plan to correct several of these problematic files, until they
have all been fixed.

I could do this all at once, but the problem is how long it ties up the
user's machine.

Just searching the My Documents folder for problematic files takes over
an hour. And, fixing all of the files at once will take even longer. I
tried just searching for the "*.xls" files and then going back to search
those for the specific sub name but just finding the "*.xls" files takes
even longer.

I can not count on the report file names being of a specific format.
each user uses a different naming convention.

Can someone suggest anything faster than this code:

With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.TextOrProperty = "BuildStreetsReports"
.MatchTextExactly = False
.filename = "*.xls"
.Execute


TIA,
Ken









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
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


All times are GMT +1. The time now is 03:54 PM.

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

About Us

"It's about Microsoft Excel"