View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
icar icar is offline
external usenet poster
 
Posts: 1
Default VB Excel file multiple opening from a folder problem

I am trying to write a macro that will open files one by one from a
folder, do stuff, plot a graph and then save them, close them and open
up the next file. My problem is that the way I have it written , I can
open the first one, do everything, and then once it opens the second
one, it still has the name of the first file as the name of the sheet
shown as the source of the plot. I tried to use .FoundFiles(i) instead
of the actual name but that gave an error. That is how I get to loop
through the files but how can I get it to work for the sheet name. Help
will be appreciated. Thanks,

Icar

This is the part of the code:

ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.SetSourceData
Source:=Sheets("IN-coarse-anm-00001").Range("C1:C31"),
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject,
Name:="IN-coarse-anm-00001"
With ActiveChart