Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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
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
Can I update vbaproject.bin in a package? Jon Peltier Excel Programming 5 January 15th 07 10:47 PM
Package and Deployment... K. Wilder Excel Programming 2 January 17th 05 01:54 AM
Best package to make COM add-in Howard Kaikow Excel Programming 8 April 1st 04 04:37 PM
Splitting an Add-in package over several Add-ins R Avery Excel Programming 1 March 1st 04 02:58 PM
How to package macro/VBA for commercial use? Haydn Williams Excel Programming 0 November 5th 03 09:16 AM


All times are GMT +1. The time now is 05:47 PM.

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

About Us

"It's about Microsoft Excel"