Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening files by VBA
Hello,
I want to open Excel-files (one by one) that are in a certain directory. With the opened files I want to do some calculations by means of a VBA macro which is stored in a already opened workbook. After the calculations the files are closed again. How do I manage to open the files one by one from the macro? An answer to this would be very helpful... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening files by VBA
Dim sFile As String
sFile = Dir("C:\TestFolders\*.xls", vbNormal) If sFile < "" Then Do 'do your stuff Debug.Print sFile sFile = Dir Loop Until sFile = "" End If -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Dutch76" wrote in message ... Hello, I want to open Excel-files (one by one) that are in a certain directory. With the opened files I want to do some calculations by means of a VBA macro which is stored in a already opened workbook. After the calculations the files are closed again. How do I manage to open the files one by one from the macro? An answer to this would be very helpful... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening files by VBA
Thanx Bob, works perfect!
"Bob Phillips" wrote: Dim sFile As String sFile = Dir("C:\TestFolders\*.xls", vbNormal) If sFile < "" Then Do 'do your stuff Debug.Print sFile sFile = Dir Loop Until sFile = "" End If -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Dutch76" wrote in message ... Hello, I want to open Excel-files (one by one) that are in a certain directory. With the opened files I want to do some calculations by means of a VBA macro which is stored in a already opened workbook. After the calculations the files are closed again. How do I manage to open the files one by one from the macro? An answer to this would be very helpful... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
show most recent files first when opening excel files | Excel Discussion (Misc queries) | |||
Several files opening at once | New Users to Excel | |||
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 | Excel Discussion (Misc queries) | |||
opening files | Excel Programming | |||
How can I view files chronologically when opening multiple files | Excel Discussion (Misc queries) |