#1
|
|||
|
|||
Why Visio VSTO can't add DataRecordsets after 10 sec. of execution?
Hello.
Why Visio VSTO can't add DataRecordsets after 10 sec. of execution? I have this method in Visio VSTO: private void btnDrawStructure_Click(object sender, EventArgs e) { Application.DoEvents(); this.Hide(); Application.DoEvents(); this.DialogResult = DialogResult.Cancel; Application.DoEvents(); ThisAddIn.dontShowTasks = chbDontShowTasks.Checked; Utils.GetProjSite(ThisAddIn.selectedProjectGuid.To String().ToUpper()); byte[] FileContent = Utils.GenerateExcelFromData(); string uploadedFileToSharePointPath = Utils.UploadFileToSharePoint(Consts.SiteBaseUrl + ThisAddIn.projectSite + @"/", Consts.DocumentLibrary, Consts.ClientSubFolder, Consts.FileName, FileContent); Utils.DrawStructure(); } and all methods before last (DrawStructure) execute about 9.5 secs. (I can add DataRecordsets in Utils.DrawStructure), but if i add one method after Utils.GetProjSite (about 1 sec of execution), all methods before last (DrawStructure) execute about 10.5 secs and I can't add DataRecordsets in Utils.DrawStructure method The problem is if I have this code: private void btnDrawStructure_Click(object sender, EventArgs e) { Application.DoEvents(); this.Hide(); Application.DoEvents(); this.DialogResult = DialogResult.Cancel; Application.DoEvents(); ThisAddIn.dontShowTasks = chbDontShowTasks.Checked; Utils.GetProjSite(ThisAddIn.selectedProjectGuid.To String().ToUpper()); Utils.GetProjManager(ThisAddIn.selectedProjectGuid .ToString().ToUpper()); byte[] FileContent = Utils.GenerateExcelFromData(); string uploadedFileToSharePointPath = Utils.UploadFileToSharePoint(Consts.SiteBaseUrl + ThisAddIn.projectSite + @"/", Consts.DocumentLibrary, Consts.ClientSubFolder, Consts.FileName, FileContent); Utils.DrawStructure(); } The method DrawStructure constant in both cases: public static void DrawStructure() { try { Globals.ThisAddIn.Application.ActiveWindow.Close() ; Globals.ThisAddIn.Application.Documents.Add("ORGCH _M.VSTX"); Visio.Document visioStencil = Globals.ThisAddIn.Application.Documents.OpenEx("WB S 2.0.VSSX", (short)Visio.VisOpenSaveArgs.visOpenDocked); Visio.Documents visioDocs = Globals.ThisAddIn.Application.Documents; Visio.Page visioPage = Globals.ThisAddIn.Application.ActivePage; SetOrientationToLandscape(visioPage); Visio.DataRecordset vsoDataRecordset; string strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" + @"Data Source=\" + Consts.projectServer + @"@SSL\DavWWWRoot\PWA" + ThisAddIn.projectSite.Replace(@"PWA/", @"") + @"\Shared Documents" + Consts.ClientSubFolder + @"" + Consts.FileName + @";" + @"Extended Properties=""Excel 12.0 Xml; HDR = YES"";" + @"Persist Security Info=False;"; string strCommand = "SELECT * FROM [Sheet1$]"; vsoDataRecordset = Globals.ThisAddIn.Application.ActiveDocument.DataR ecordsets.Add(strConnection, strCommand, 0, "PrjStruct"); ... |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Baseline Execution Index (BEI) in Project 365 | advillanuevag | Project | 3 | 05-02-2021 12:52 PM |
How to insert custom control into Office Word document - VSTO | Tycho | Word VBA | 4 | 04-01-2021 09:24 AM |
Word VSTO Content Control binding to XML issue | phyrjc | Word | 0 | 03-25-2019 08:56 AM |
Word 2017 + VSTO 2015 events | ArtKilp | Word VBA | 0 | 11-20-2018 08:57 AM |
Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 | fidecourt | PowerPoint | 2 | 02-26-2013 10:25 AM |