macros to write to sperate files

N

newbee

I have learned to create basic macros. Now i have a more complex issue; I
need a macro to place an excel graph in a new file by project. THe excel
workbook contains a data sheet and 45 pages with one graph on each. The page
"name" is the project #.
I got the macro to to write each graph into a seperate ppt page just fine.
Now instead, need it to write each graph to a seperte ppt file. All I get is
the same graph over and over in each file. Help!
 
N

newbee

Presentations.Add WithWindow:=msoTrue
ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=1,
Layout:=ppLayoutTitle).SlideIndex
ActiveWindow.Selection.SlideRange.Layout = ppLayoutBlank
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120,
Top:=110, Width:=480, Height:=320, FileName:="C:\Documents and
Settings\G5PMCJB9\My Documents\2101\P2_Data_8Oct2008.XLS",
Link:=msoFalse).Select
ActivePresentation.SaveAs FileName:="C:\Documents and
Settings\G5PMCJB9\My Documents\argosy1008.ppt"
Presentations.Add WithWindow:=msoTrue
ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=1,
Layout:=ppLayoutTitle).SlideIndex
ActiveWindow.Selection.SlideRange.Layout = ppLayoutBlank
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120,
Top:=110, Width:=480, Height:=320, FileName:="C:\Documents and
Settings\G5PMCJB9\My Documents\2101\P2_Data_8Oct2008.XLS",
Link:=msoFalse).Select
ActivePresentation.SaveAs FileName:="C:\Documents and
Settings\G5PMCJB9\My Documents\blacksnake 1008.ppt"
Presentations.Add WithWindow:=msoTrue
ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=1,
Layout:=ppLayoutTitle).SlideIndex
ActiveWindow.Selection.SlideRange.Layout = ppLayoutBlank
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120,
Top:=110, Width:=480, Height:=320, FileName:="C:\Documents and
Settings\G5PMCJB9\My Documents\2101\P2_Data_8Oct2008.XLS",
Link:=msoFalse).Select
ActivePresentation.SaveAs FileName:="C:\Documents and
Settings\G5PMCJB9\My Documents\blueriver1008.ppt"
End Sub


IDealy, the new ppt files names would chagne each time it is run. ALso, If I
do rerun the macro it only uses one graph (the same graph) for each new
file...thanks for looking
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top