View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
natarajr natarajr is offline
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