Reputation: 31
I am using visio 2013 drawing control. When I save a file as vsd it is throwing exception "File not found". However file is saved on given location. Since file is saved , I ignore the exception but on reloading the same file it is throwing "Error HRESULT E_FAIL has been returned from a call to a COM component" exception.
Everything is working fine if I used vsdx extension instead of vsd. But I save file as vsd for backward compatibility.
below is the code that all I am doing. I have also tried to set application version to 2010 but nothing is working.
private void btnSave_Click(object sender, EventArgs e)
{
try
{
string fileName = "C:\\test\\mydrawing1.vsd";
axDrawingControl1.Document.SaveAsEx(fileName, (short)VisOpenSaveArgs.visSaveAsWS);
//axDrawingControl1.Document.SaveAs(fileName);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnReload_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.ShowDialog();
try
{
this.axDrawingControl1.Src = op.FileName;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnOpen_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.ShowDialog();
this.axDrawingControl1.Src = op.FileName;
}
Upvotes: 1
Views: 2499
Reputation: 31
It is a bug in visio 2013 drawing control .See below KB
http://support.microsoft.com/kb/2900075
Upvotes: 0