Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.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 Whe=xlLocationAsObject, Name:="IN-coarse-anm-00001" With ActiveChart |
#2
Posted to microsoft.public.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 icar wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening each file in a folder using msoFileDialogFolderPicker | Excel Discussion (Misc queries) | |||
opening file from ftp folder | Excel Discussion (Misc queries) | |||
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp | Excel Discussion (Misc queries) | |||
Opening an excel file from folder view | Excel Discussion (Misc queries) | |||
how to see file details without opening each folder | Excel Discussion (Misc queries) |