Re: Caching?
- From: "Dean" <whooshbopbang4@xxxxxxxxxxxx>
- Date: Wed, 8 Nov 2006 09:55:03 -0800
I wasn't intending the value file 1 name to be taken literally - the issue
seemed to be that the filename started with the word value, not that this
might change your answer. And regardless of why I changed the filename, I
did change it, and the file kept looking for the old input filename. Then,
when I deleted the file altogether, the macro would not finish.
The author of the macro now says (and I quote):
"It wasn't handling the OT workbook correctly and was trying to process it
as well. I'd thought I had worked around it well enough knowing it was
going to be picked up by the FileSearch object, but I missed a line and it
was what was causing the program to crash on the last file every time. "
In any event, I will ask the author to look at this thread, but it has
gotten too high level for me to understand now, and I think it's time for me
to let it go, since everything is working now, for whatever reasons, though
it bothers me that the main problem was exhibited only on my most used, most
powerful, computer. Fortunately, this macro was for a one time only job so
I can probably 'get over it'.
Thanks so much for all your help and advice. I'm sure it's to prevent spam,
but do I add dot com to your e-mail address shown?
Dean
"Peter T" <peter_t@discussions> wrote in message
news:OfsvS6xAHHA.992@xxxxxxxxxxxxxxxxxxxxxxx
Perhaps I didn't pick up on what you re-describe below, it's been
difficult
to follow and got distracted by other problems with the code.
The only thing I can think of that might explain that scenario is if
somehow
the app-Filesearch is not correctly clearing an old search particularly in
view of the filesearch object being retained as Global between sessions,
however I would expect FS.NewSearch to reset. I tried to recreate your
overall set-up with a few files and tried to run the original code.
However your code was throwing up errors in various places, particularly
incorrectly keeping track of arrays. So without spending a lot of time
rewriting not possible to get to the bottom of it. However at no time did
Filesearch falsely find the oldname of a renamed file.
Despite that I'm still slightly suspicious that in your set-up of files
Filesearch just might return the old-name of a renamed file. See if you
can
re-create the problem as before. If so entirely delete or move the rogue
renamed file out of the search path. Make a new similar file with same
new-name in the search path. Repeat the search, any difference.
If the oldname was found first time but recreate the problem again and in
Sub GetFileList(), after the line With FS, add the following
.MatchTextExactly = True
(not sure why that would make a difference but just in case)
In passing I can't see any reason the code can't work with "value file1".
The function GetFileDate tries to find if the last part of the name is a
valid date. "1" is a valid date, namely 12-31-1899. If the name does not
contain a trailing valid date the function would loop forever.
Regards,
Peter T
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:samdnfIh_c77pMzYnZ2dnUVZ_uadnZ2d@xxxxxxxxxxxxxxx
<< Not sure what you mean by "somehow, EXCEL remembers what files wereinput
called"
other than use of the globals, variables declared at the top of the
module
(the code could be written without those). >>
At the expense of belaboring things, I am referring to the fact that I
ran
the macro and learned that it did not like one of the input file
filenames
it saw - let's call it "value file1" - I later learned that the
programmer
didn't allow for just any filename. So, I renamed (didn't copy) the
file to "portfolio file 1", a name that I knew would be compatible,I
Then,
got a FRESH COPY of the template with the macro in it and reran theIn
macro.
It then crashed saying it couldn't find "value file 1".
To my simple brain, this should be impossible, unless parts of the macro
somehow reach outside the calling file.
Dean
"Peter T" <peter_t@discussions> wrote in message
news:eiG7HBtAHHA.996@xxxxxxxxxxxxxxxxxxxxxxx
There are many reasons for memory leaks, some very hard to track down.
don'tthe case of the code you posted the use of statement is 'End' will
cause
that particularly with all those global variables and arrays. But I
NewSearchthink that's not why the code failed. There can be issues with the
FileSearch but also don't think relevant here as it starts with
module(I
might be wrong).
Not sure what you mean by "somehow, EXCEL remembers what files were
called"
other than use of the globals, variables declared at the top of the
simple(the code could be written without those).
If you've already re-installed Excel don't worry about trying to
'reverse'.
Regards,
Peter T
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:jICdnZl8DM9XgMzYnZ2dnUVZ_vqdnZ2d@xxxxxxxxxxxxxxx
I think it is this whole concept of memory leaks that is beyond my
called,intellect! ... that it appears that you can run a macro, then exitfile
the
without saving, and yet, somehow, EXCEL remembers what files were
soand expects to find them again - stuff like that. Is there any URL orsuffer
thread that I might use to educate myself on this, just conceptually?
Unfrotmautely, I did reinstall EXCEL. Can I use system restore to
reverse
that and, if so, do you think I should bother if all is just as it was
before. Isn't a clean copy always a good idea, if you're willing to
through the installation?
Thanks so much for all your hard work. I'm sorry that there had been
andmany iterations by the time you saw it!
Dean
"Peter T" <peter_t@discussions> wrote in message
news:%23IAt0LsAHHA.2140@xxxxxxxxxxxxxxxxxxxxxxx
Yes our two recent posts crossed.
Concerning your question in capitals in your other recent message,
numberthesimilar 'what's going on' Q below I can only assume it's down to a
combination of you not understanding the code (not your fault), a
difference
in the files and/or locations in respective systems and in
particular
way the code is written. As I mentioned a while back there are a
thatof
ourthings that could lead to errors which are not handled, and other
things
that could result in memory leaks.
However nothing I see likely to require re-installing Excel as you
expected
in your other thread.
Regards,
Peter T
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:rJadnfsEuaPWkszYnZ2dnUVZ_s6dnZ2d@xxxxxxxxxxxxxxx
I am confused by which message you mean by my last message.
Perhaps,
posts are crossing one another. I am looking at your initial code
macrois
in
my present renamed file and it is all green fonted. I wascertain
virtually
it was in the last run too, when something seemingly caused the
symptomto
file,begin having questions about whether I wanted to reopen the calling
something it was not doing previously - it was just terminatingprematurely.
I agree that a commented macro cannot matter, so I have to assume
that,
somehow, something caused it to start that line of inquiry, a
memory?listthatI
had seen some time ago, admittedly. In terms of why the file isworking
now
perfectly when the only difference is this that it has been again
renamed,
albeit with commented out code, and the fact that I did a file dump
must have something to do with the latter, I assume.
Can doing a file dump list somehow clear out EXCEL's or VBA's
noteIndeed, this file never had a problem on other computers. I also
messagethat,
after the file would stop prematurely, at the bottom left, the
but"processing file 19 of 20" would linger until I closed out EXCELcompletely.
Does any of this make sense?
D
"Peter T" <peter_t@discussions> wrote in message
news:O2toE1rAHHA.2328@xxxxxxxxxxxxxxxxxxxxxxx
What confuses me is how putting in a bunch of stuff
that is all commented out can change the running of the macro,
codelineindeed
it
seems to have created a new problem to boot.
When a code line is commented, ie preceded with an apostrophe,
the
will
turn green (subject your VBE options). In this state commented
particulardoes
absolutely nothing. In other words inserting what I previously
suggested
will neither remove errors nor create them. However, the
toremovedIcode
suggested should not cause any errors even with the apostrophes
and
hence executed.
When the code breaks remove the comments, drag the yellow cursor
stuffthe
first line of code and 'step through' with F8. You should see
noin
thisthe
immediate window as I described before.
Why didn't you try the test code I suggested in my last message.
Regards,
Peter T
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:WZidnfu4ev3fY83YnZ2dnUVZ_qudnZ2d@xxxxxxxxxxxxxxx
It wasn't that I couldn't comment out the rows, it's just that I
didn't
think you would want me to. The reason I didn't is because,
with
new
filename dialog box, error, it seems like the yellow cursor was
waslonger
where it used to be. In the past, when the macro bombedhighlighted
because
it
could
not find an old input filename I had renamed, it would be yellow
at the "For dFileCount = 0 ..."row, which is just prior to the
stuff
we
inserted - just a reminder, after I deleted the renamed file,
the
macro
no
longer produced an error message, it just terminated
prematurely.
Now, the yellow cursor is at the line just after all the stuff
we
inserted
so I didn't think commenting it out would help, since the macro
buthavealready
past it - at least for the current iteration. It's as if, now,
I
a
new
problem to deal with. What confuses me is how putting in a
bunch
of
stuff
that is all commented out can change the running of the macro,
them.codeindeed
it
seems to have created a new problem to boot.
Kindly respond.
I will try your suggestion.
Thanks
Dean
"Peter T" <peter_t@discussions> wrote in message
news:uZWtYnpAHHA.3396@xxxxxxxxxxxxxxxxxxxxxxx
I'm not really following all this, also not sure why after the
breaks
you can't then uncomment those lines and then step through
asa
It sounds like arrFiles contains the name of your open file
and
hence
problem when the code tries to open such a file. Not sure how
_whatfrom
I
can make out the procedure GetFileName should eliminate.
In the same module add the following and run it
Sub DumpFileList()
Dim dFileCount As Long
GetFileList
ActiveWorkbook.Worksheets.Add
For dFileCount = 0 To UBound(arrFiles)
S = n = InStrRev(S, "\")
Cells(dFileCount + 1, 1) = _
Right(arrFiles(dFileCount), Len(arrFiles(dFileCount)) -
toyouInStrRev(arrFiles(dFileCount), "\"))
Cells(dFileCount + 1, 2) = arrFiles(dFileCount)
Next
End Sub
Inspect the list of filenames & fullnames, does it include
everything
expect or does it include your open file name.
If that looks OK, run your code again. When it breaks be sure
errorsub,press
bedbug (not end), drag the yellow arrow all the way down to
End
cursorpress
F8 which should take it back to ImportFiles, drag the yellow
takenagain.down
to
End sub again. In DumpFileList comment out DumpFileList and
run
Are
the two lists the same.
Regards,
Peter T
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:ocSdnfNR7e_RJs3YnZ2dnUVZ_oKdnZ2d@xxxxxxxxxxxxxxx
I assume that this was to be added to the macro with nothing
imported),out,
right? If so, this is what happened.
At the point where it usually halts (the 19th file being
askedinstead
it informed me that "outputtemplate.xls" is already open and
thatif
I
wanted to re-open it. Since "outputtemplate" is the very
file
the
macro is inside of, I answered no! I then got a run time
couldline1004.
Ctrl
G didn't do anything, but I assume it is the same as choosing
the
debug
button, which I did. The yellow highlight was not in the
"for"
but
in
the line after, "workbooks open..., so there was no way I
Imove
it
to
the next uncommented line, except to move it backwards,
which,
soassume,
makes no sense.calling
This business of the macro asking for the same file which is
already
it has also been a fleeting symptom on this one machine.the
Yes,
it
is
in
folder that the macro is supposedly polling for its contents,
changesdeleted.it's
not
as
outrageous as when it asks for files that were previously
Just to be sure, I reran the template twice without your
wantedand,
neither time, did it produce this dialog box asking if I
Ito
seemsre-open
the calling file. I am not the sharpest knife in the drawer
but,
considering that everything we added was commented out, that
linepretty
odd, don't you think?
Thanks a lot!
Dean
"Peter T" <peter_t@discussions> wrote in message
news:u%23QR2jlAHHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
Add the following after the For dFileCount = 0 line
For dFileCount = 0 To UBound(arrFiles)
' Application.ScreenUpdating = true
' Debug.Print Err.Number; Err.Description
' Debug.Print "dFileCount ", dFileCount
' Debug.Print "UBound(arrFiles) ", UBound(arrFiles)
' If dFileCount <= (arrFUBoundiles) Then
' Debug.Print (arrFUBoundiles)
' End If
' Exit Sub
When the code breaks:
- press ctrl-g to open the Immediate (debug) Window
- remove the comments
- drag the yellow cursor down to the first newly
uncommented
error- press F8 repeatedly to Step through the code
Are the dubg comments consistent with what you expect, any
revisingmessages
while stepping through.
Regards,
Peter T
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:iu-dnQfsm8Zea9LYnZ2dnUVZ_vWdnZ2d@xxxxxxxxxxxxxxx
Well, this is where it gets even messier. The author kept
themaco
to try to make the problems go away, with no success.
What
errorsent
you
was
his latest version. In this last version, there is no
differentfilemessage -
it
just stops prematurely at the spot where there used to be
a
that
was
deleted or renamed. I think this is not materially
justfrom
the
original file, as far as the failure modes. It was also
afterstopping
without finishing, later on, aftre i deleted the renamed
file.
But,
in
terms of the original macro, when it first bombed out,
yellowrenamedI
notthe
file but before I chose to delete the renamed file, it
said
it
could
find the file I had deleted, and when I hit debug, the
subroutine,backgorund
hihglight was at what is now:
For dFileCount = 0 To UBound(arrFiles)
If you can stomach to read on, here is the exact
0as
it
was
then.
The actual line hihglighted is the very first line: For d
=
+To
UBound(arrFiles).
Public Sub ImportFiles()
For d = 0 To UBound(arrFiles)
Application.ScreenUpdating = False
If arrFiles(d) <> Empty Then
GetTheDate (arrFiles(d))
Workbooks.Open (arrFiles(d))
Application.StatusBar = "Processing file " & d
2).Select&1
Active***.UsedRange.Rows.Count":
"
&
arrFiles(d)
sDF = ActiveWorkbook.Name
For s = 1 To ActiveWorkbook.Sheets.Count
Sheets(s).Select
s*** = Active***.Name
If s*** = "lcg" Or s*** = "LCG" Or _
s*** = "lcv" Or s*** = "LCV" Or _
s*** = "mcg" Or s*** = "MCG" Or _
s*** = "mcv" Or s*** = "MCV" Or _
s*** = "scg" Or s*** = "SCG" Or _
s*** = "scv" Or s*** = "SCV" Then
Cells.Select
Selection.MergeCells = False
Range("A4").Select
dRowCount =
Paste:=xlPasteValuesRange("A4:A" & dRowCount).Select
Selection.Copy
Workbooks(sOT).Activate
Sheets(sSheet).Select
If Range("E4").Value = Empty Then
Range("E4").Select
End If
dStart = ActiveCell.Row
Selection.PasteSpecial
Paste:=xlPasteValuesActiveCell.Offset(0, -2).Select
Workbooks(sDF).Activate
Range("A4").Select
Range("C4:C" & dRowCount & ",D4:D" &
dRowCount).Select
Selection.Copy
Workbooks(sOT).Activate
Selection.PasteSpecial
Selection.End(xlDown).Offset(1,
pastesthatActiveCell.Offset(-1,Range("A" & dStart & ":A" &
0).Row).Value = sDate
Workbooks(sDF).Activate
End If
Next
Application.DisplayAlerts = False
Workbooks(sDF).Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End If
Next
Application.StatusBar = False
End Sub
Thnaks!
Dean
"Peter T" <peter_t@discussions> wrote in message
news:%23ioMICgAHHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
At a quick glance of the code there are various
scenarios
Keepproblematicmight
whenerror.
Which line does the code stop on, if necessary press
Ctrl-Break
you
get
the get the error message.
Regards,
Peter T
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:U5OdnZu4J8d0MNLYnZ2dnUVZ_uidnZ2d@xxxxxxxxxxxxxxx
Peter T has requested the code for the macros in my
template,
to
help figure out why one computer has a problem with it.
filesin
mind
basciallythat
it only doesn't work on one machine. The output file
macro
looks
for all the files in the same folder as it, counts the
somehting(I
think),and
extracts the date from the input filenames (usually
like
"all
portfolio data - 05-31-06.xls") and also copies and
thoughcalled.some
fromdata
them into the output template from whihc the macro is
Right now, the macro always stops at file #19, even
plusthere
justareusually
21 and 22 input files in my small test sample. No
error
message,
it
stops prior to processing the last couple of files,
filesome
final
overhead, and apparently quits. Originally, the 19th
simialrnotawas
file
that
turned out to have a weird filename that the macro
could
theextract
date from. So I renamed it into a format that was
theto
macro,the
other
fiels that were accepted. When I did this and reran
the
it
crashed,
saying it couldn't find a file with the old filename,
deleteone
it
versiondidn't
like, the one that I renamed. To be safe, I copied in
a
fresh
of
thethe output template file into the same folder and tried
again.
But
error message was the same. So, I chose to simply
stopsthe
now,(renamed)
input file that had been giving me the problem. As I
said,
each
timeI
attempt to run it on my one best computer, it simply
problem.prematurely.
Other, lesser, computers don't seem to have this
myI
someonetried
nowfathomputting
it all in a new folder - nothing helped.
Since I always run with a fresh copy of the template, I
cannot
how
it
can seemingly remember that some old filename, or old
file,
is
foldernot
included. It's supposed to find what files are in the
same
be!whenyou
run the macro. I'ts not supposed to already know what
they
might
Thanks! Here is all the macro, done by someone
skilled,
whonow
is
perplexed. It runs fine on his machine, as it does on
dSheetsStringother
aremachines,
just not on my main computer. No macro buttons or
toolbars
String,involved.
Option Explicit
Public sPath As String, sAppName As String, sFileName
As
sData
As
String
Public s*** As String, sDate As String
Public sShares As String, sPrice As String, sTicker As
Public FS
Public arrFiles, arrData
Public dFileCount As Double, dRowCount As Double,
itsAs
arrFiles(UBound(arrFiles)Double
.FoundFiles(dFileCount)Public dPF As Double
Public Sub ImportFiles()
GetFileList
ProcessFiles
PopulateTemplate
SortByDate
End Sub
Public Sub GetFileList()
sPath = ActiveWorkbook.Path & "\"
sAppName = ActiveWorkbook.Name
If IsDim(arrFiles) = True Then arrFiles = Empty
If IsDim(arrData) = True Then arrData = Empty
Set FS = Application.FileSearch
With FS
.NewSearch
.LookIn = sPath
.SearchSubFolders = True
.Filename = "*.xls"
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then
ReDim arrFiles(0)
For dFileCount = 1 To .FoundFiles.Count
GetFileName (.FoundFiles(dFileCount))
If sFileName <> ActiveWorkbook.Name
Then
arrFiles(dFileCount - 1) =
ReDim Preserve
+
1)
End If
Next
Else
MsgBox "No files found in " & sPath & " or
<>Workbooks(sFileName).Sheets.CountdFileCountsub-folders."
End
End If
End With
If IsEmpty(arrFiles(UBound(arrFiles))) = True Then
ReDim Preserve arrFiles(UBound(arrFiles) - 1)
End If
End Sub
Public Sub ProcessFiles()
Application.ScreenUpdating = False
For dFileCount = 0 To UBound(arrFiles)
Workbooks.Open (arrFiles(dFileCount))
GetFileName (arrFiles(dFileCount))
GetFileDate
Application.StatusBar = "Processing file " &
"&
:
&"
sFileName
For dSheets = 1 To
Active***.UsedRange.Rows.CountSheets(dSheets).Select
If CheckSheetName = True Then
dRowCount =
Range("A4").Select
For dPF = 0 To dRowCount - 3
If ActiveCell.Offset(dPF, 0).Value
0).SelectFalseEmpty
And
IsNumeric(ActiveCell.Offset(dPF, 0).Value) = False Then
If dPF = 0 And IsDim(arrData) =
&Then
arrData(UBound(arrData)ReDim arrData(0)
Else
ReDim Preserve
+
1)
End If
sData = UCase(s***) & ";" &
sDate
&&";"
_
ActiveCell.Offset(dPF,
0).Value
&&";"
_
ActiveCell.Offset(dPF,
2).Value
arrData(UBound(arrData) -Then&";"
_
ActiveCell.Offset(dPF,
3).Value
arrData(UBound(arrData)) =
sData
End If
Next
End If
If IsDim(arrData) = True Then
If IsEmpty(arrData(UBound(arrData))) =
True
ReDim Preserve
Please1)
End If
End If
Next
Application.DisplayAlerts = False
Workbooks(sFileName).Close
Application.DisplayAlerts = True
Next
Application.StatusBar = False
Application.ScreenUpdating = True
End Sub
Public Sub PopulateTemplate()
Application.ScreenUpdating = False
For dPF = 0 To UBound(arrData)
Application.StatusBar = "Populating template.
wait...
&"
dPF & " of " & UBound(arrData)
SplitVariables (arrData(dPF))
Sheets(sSheet).Select
Range("A4").Select
If ActiveCell.Value <> "" Then
If ActiveCell.Offset(1, 0).Value = "" Then
ActiveCell.Offset(1, 0).Select
Else
Selection.End(xlDown).Offset(1,
2)+End If
End If
ActiveCell.Value = sDate
ActiveCell.Offset(0, 2).Value = sShares
ActiveCell.Offset(0, 3).Value = sPrice
ActiveCell.Offset(0, 4).Value = sTicker
Next
arrData = Empty
Application.StatusBar = False
Application.ScreenUpdating = True
End Sub
Public Sub GetFileName(TheFile As String)
sFileName = Strings.Replace(TheFile, sPath, "")
Do Until InStr(1, sFileName, "\") = 0
sFileName = Mid(sFileName, InStr(1, sFileName,
"\")
1,
Len(sFileName))
Loop
End Sub
Public Sub GetFileDate()
sDate = Strings.Replace(sFileName, ".xls", "")
sDate = Right(sDate, 10)
Do Until IsNumeric(Mid(sDate, 1, 1)) = True
sDate = Trim(Mid(sDate, 2, Len(sDate)))
Loop
If InStr(1, sDate, "-") = 0 And Len(sDate) = 6 Then
sDate = Mid(sDate, 1, 2) & "-" & Mid(sDate, 3,
have"-"&
&Mid(sDate,
5, 2)
End If
sDate = Format(sDate, "M/d/yyyy")
If IsDate(sDate) = False Then
MsgBox "The following file does not appear to
"Resettinga
valid
date
in
the filename:" & vbNewLine & vbNewLine & _
sFileName & vbNewLine & vbNewLine &
andTheString,this
Chr(10)file.",Order1:=xlDescending,
vbCritical, "Invalid Date"
ResetWorkbook
End
End If
End Sub
Public Sub SortByDate()
Application.ScreenUpdating = False
For dSheets = 1 To ActiveWorkbook.Sheets.Count
Sheets(dSheets).Select
s*** = Active***.Name
If CheckSheetName = True Then
GetRowCount
Range("A4:E" & dRowCount).Select
Selection.Sort Key1:=Range("A4"),
Key2:=Range("E4") _
, Order2:=xlAscending,
Header:=xlNo
Range("A4").Select
Range("B4").Formula =
"=vlookup(E4,LOOKUP!C:D,2,FALSE)"
Range("B4").AddComment
Range("B4").Comment.Text Text:="Dean:"
&
&
"At
the
end, Dean will copy this down as far as he needs to."
End If
Next
Sheets(1).Select
Application.ScreenUpdating = True
End Sub
Public Sub ResetWorkbook()
Application.ScreenUpdating = False
Sheets("LCG").Select
Range("A4:A65536").EntireRow.Delete shift:=xlUp
Sheets("MCG").Select
Range("A4:A65536").EntireRow.Delete shift:=xlUp
Sheets("LCV").Select
Range("A4:A65536").EntireRow.Delete shift:=xlUp
Sheets("MCV").Select
Range("A4:A65536").EntireRow.Delete shift:=xlUp
Sheets("SCG").Select
Range("A4:A65536").EntireRow.Delete shift:=xlUp
Sheets("SCV").Select
Range("A4:A65536").EntireRow.Delete shift:=xlUp
Sheets("LCG").Select
Application.ScreenUpdating = True
End Sub
Public Function CheckSheetName() As Boolean
CheckSheetName = False
s*** = Active***.Name
If s*** = "lcg" Or s*** = "LCG" Or _
s*** = "lcv" Or s*** = "LCV" Or _
s*** = "mcg" Or s*** = "MCG" Or _
s*** = "mcv" Or s*** = "MCV" Or _
s*** = "scg" Or s*** = "SCG" Or _
s*** = "scv" Or s*** = "SCV" Then
CheckSheetName = True
End If
End Function
Public Function IsDim(arr As Variant) As Boolean
On Error GoTo errNotDim
Dim d As Double
d = UBound(arr)
IsDim = True
Exit Function
errNotDim:
IsDim = False
End Function
Public Sub SplitVariables(TheString)
Dim arrVars(4), dVar As Double
For dVar = 0 To 3
arrVars(dVar) = Mid(TheString, 1, InStr(1,
+";") -
1)
TheString = Mid(TheString, InStr(1, TheString,
";")
1,
Len(TheString))
Next
arrVars(4) = TheString
s*** = arrVars(0)
sDate = arrVars(1)
sTicker = arrVars(2)
sShares = arrVars(3)
sPrice = arrVars(4)
End Sub
Public Sub GetRowCount()
Range("A4").Select
If ActiveCell.Value <> "" Then
If ActiveCell.Offset(1, 0).Value = "" Then
dRowCount = ActiveCell.Row
Else
Selection.End(xlDown).Select
dRowCount = ActiveCell.Row
End If
End If
Range("A4").Select
End Sub
"Dean" <whooshbopbang4@xxxxxxxxxxxx> wrote in message
news:mrmdnUqrQu7H79DYnZ2dnUVZ_t6dnZ2d@xxxxxxxxxxxxxxx
I have a template that basically uses a macro to copy
pastepaste
from
all
input files that are placed in its same folder and
eachintothat
stuff
itself. It also extracts the dates from the end of
runof
there,the
knowfilenames.
I ran it with a lot of files there and it, basically,
worked.
I
that
it does not know the names of the files that will be
in
advance.
Then, I start over with a fresh template and try to
anit
again
manywith
of the files removed from the folder, and VB gives me
Iserror
saysmessage
telling me it can't find some of the removed files.
Someone
it's
some sort of caching, apparently. I don't
understand.
morecreatedthere
thatwaysome
to clear EXCEL caches? How would a fresh copy know
of
files
it,
presumably, has never seen?
Let me know if I need to show you the macro, which
was
by
somebody
else. I hope not because it seems that my question
is
basic
Thanks!
Dean
.
- Follow-Ups:
- Re: Caching?
- From: Peter T
- Re: Caching?
- References:
- Caching?
- From: Dean
- Re: Caching?
- From: Dean
- Re: Caching?
- From: Peter T
- Re: Caching?
- From: Dean
- Re: Caching?
- From: Peter T
- Re: Caching?
- From: Dean
- Re: Caching?
- From: Peter T
- Re: Caching?
- From: Dean
- Re: Caching?
- From: Peter T
- Re: Caching?
- From: Dean
- Re: Caching?
- From: Peter T
- Re: Caching?
- From: Dean
- Re: Caching?
- From: Peter T
- Re: Caching?
- From: Dean
- Re: Caching?
- From: Peter T
- Caching?
- Prev by Date: Buttons to run macro do not work ...
- Next by Date: Re: Option Buttons
- Previous by thread: Re: Caching?
- Next by thread: Re: Caching?
- Index(es):