PDA

View Full Version : Tile pictures on a worksheet & "Save As" option



greymalkin
12-17-2007, 01:44 PM
Hello All,

I have been working on an Excel VBA tool for a few months now that queries a database based on groups/filters the user specifies and then builds custom reports and charts from that data.

I am building the report and making custom charts, but I want to be able to tile the charts on a page. Currently when I build a chart I have the chart show up on a worksheet page and a button that allows the user to copy the chart as a picture to a different worksheet. The idea is that the user can build as many custom charts as they want and add the good ones to a collection to save or print later on.

My question is, is it possible to easily tile these charts (or I guess by this time they are just pictures) on a worksheet? I plan on having approx. 4 to a landscape worksheet.

Additionally, I have found out how to use the saveAs function in excel VBA and have it prompting the user for a filename using an inputBox but I wanted to know if I can write the code to where when the user clicks a save button it will bring up the regular "save as" window and only save that sheet?

thanks for your time!

Bob Phillips
12-17-2007, 02:41 PM
Do you know the names of these pictures? If so, you can just access them via the Shapes collection, which has a Left and a Top Property.

As to the SaveAs, you can use GetSaveAsFilename to get the user to supply a filename, and then just do a Copy of the sheet, which creates a new workbook, and save that



Activesheet.Copy
Activeworkbook.SaveAs that_filename