Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
import package from
I have a certain package that I import from the same location on multiple
files each week. I recorded a macro to import the file but the macro does not automatically import the file from the location and filename I used when recording the macro. The macro stops when it gets to the object packager box. I would like it to automatically select the location and name of the file since it never changes and then update the form. What VB code could I use to do this? Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
import package from
You can do something like the code below. Put the filenames into an array
Sub test() Folder = "c:\temp\test\" Files = Array( _ "abc_1.xls", _ "abc_2.xls", _ "abc_3.xls", _ "abc_4.xls") For Each file In Files Workbooks.Open Filename:=Folder & file ActiveWorkbook.Close Next file End Sub "Jeremy R." wrote: I have a certain package that I import from the same location on multiple files each week. I recorded a macro to import the file but the macro does not automatically import the file from the location and filename I used when recording the macro. The macro stops when it gets to the object packager box. I would like it to automatically select the location and name of the file since it never changes and then update the form. What VB code could I use to do this? Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I update vbaproject.bin in a package? | Excel Programming | |||
Package and Deployment... | Excel Programming | |||
Best package to make COM add-in | Excel Programming | |||
Splitting an Add-in package over several Add-ins | Excel Programming | |||
How to package macro/VBA for commercial use? | Excel Programming |