View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Matt S Matt S is offline
external usenet poster
 
Posts: 112
Default Running macro on multiple files

Jim,

I'm new to macros... can you please paste your code so I can see where
you've changed path to sPath?

Thanks,
Matt

"Jim Cone" wrote:


I changed "path" to sPath and used "C:\WINDOWS\Temp" as the path
and it picked up every file in the folder.
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Matt S"
wrote in message
I posted this earlier on an old thread, but I guess it doesn't bump the old
thread for people to see. I hope I'm not breaking any rules or whatever, so
please ignore this post if I am.
Thanks,
Matt

-snip-
"If I step through the code, it just goes right over the While loop,"
-snip-

Sub ProcessAllFiles()
Dim sFile$
Const path = "C:\Temp\Temp1\"
sFile = Dir(path & "*.*")
Do While sFile < ""
Workbooks.Open (path & sFile)
HELO_Macro
ActiveWorkbook.Close savechanges:=True
sFile = Dir
Loop
End Sub