I have created an application that uses Microsoft.Office.Interop for Excel.
I'm trying to implement both an OpenFileDialog and a SaveFileDialog. I got the OpenFileDialog to work, but I have run into a wall on the SaveFileDialog. Because when I get to the SaveFileDialog box, it lets me pick the location, file name and extension...but nothing shows up in the spot where I'm saving to. I feel like I'm missing something simple, so maybe someone in here can help.
The code I have so far (not sure where it's even correct or not) is below. What I am prompting the SaveFileDialog for is to save an Excel file. How do I link the Excel object to the path created by the SaveFileDialog?
public void Save_File()
{
//creating an SaveFileDialog object, to save Excel File.
SaveFileDialog dialog = new SaveFileDialog();
dialog.InitialDirectory = "c:/desktop";
dialog.Title = "Select Where To Save File";
dialog.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx|All files (*.*)|*.*";
dialog.ShowDialog();
}//end method Save_File
Thanks in advance!