|
|
VB Excel file multiple opening from a folder problem |
|
Author |
Message |
Aishwaryadasan
|
Posted: Sat Sep 20 19:11:35 CDT 2003 |
Top |
Excel Programming >> 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 Where:=xlLocationAsObject,
Name:="IN-coarse-anm-00001"
With ActiveChart
Excel466
|
|
|
|
|
Tom
|
Posted: Sat Sep 20 19:11:35 CDT 2003 |
Top |
Excel Programming >> VB Excel file multiple opening from a folder problem
Source:=Worksheets(1).Range("C1:C31"),
Might be what you want, but hard to tell with the limited information you
provided.
--
Regards,
Tom Ogilvy
> 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 Where:=xlLocationAsObject,
> Name:="IN-coarse-anm-00001"
> With ActiveChart
|
|
|
|
|
|
|