LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Workbook Open Macro


This below macro used to work in the older version of excel. It does
not work now. Any help is appreciated!!
Thanks

Sub OpenPrintMacro()

Dim Fname

For i = 1 to 5

Fname = Worksheets("FileNames").Range("a"+i).value
Workbooks.open.filename:= "C:\My Documents\Files\" & Fname
ActiveWindow.selectedsheets.Printout copies:=1
ActiveWorkbook.close

Next i
End Sub




WorkSheet FileNames

Range a1 = Test1.xls
Range a2 = Test2.xls
Range a3 = Test3.xls
so on and so forth.............


--
natarajr
------------------------------------------------------------------------
natarajr's Profile: http://www.excelforum.com/member.php...o&userid=27807
View this thread: http://www.excelforum.com/showthread...hreadid=473174

 
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
Macro in 2nd Open workbook Steve Excel Discussion (Misc queries) 1 January 28th 08 05:35 PM
Run a macro when I open a workbook CraigJ Excel Discussion (Misc queries) 1 June 13th 07 04:04 PM
How to Run Macro in open workbook/s hni Excel Discussion (Misc queries) 1 October 31st 05 10:14 AM
Run macro in one open workbook only Paul S[_4_] Excel Programming 5 August 30th 05 12:49 PM
run macro on only one open workbook Pete Merenda Excel Programming 7 July 21st 05 03:29 PM


All times are GMT +1. The time now is 07:12 AM.

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"