Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2022, 07:27 AM
sytec sytec is offline Why Visio VSTO can't add DataRecordsets after 10 sec. of execution? Windows 10 Why Visio VSTO can't add DataRecordsets after 10 sec. of execution? Office 2016
Novice
Why Visio VSTO can't add DataRecordsets after 10 sec. of execution?
 
Join Date: Apr 2022
Posts: 6
sytec is on a distinguished road
Default 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");
...
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Visio VSTO can't add DataRecordsets after 10 sec. of execution? 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
Why Visio VSTO can't add DataRecordsets after 10 sec. of execution? Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 fidecourt PowerPoint 2 02-26-2013 10:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft