STA issue with DataGridView

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
This topic is 14 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

STA issue with DataGridView

Post by Alexander Riedel »

We are working on it. We will post as soon as a permanent solution is available.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Xenophane
Posts: 29
Last visit: Wed Feb 03, 2021 3:59 am

STA issue with DataGridView

Post by Xenophane »

I see this did not make it into the 1.1 release, so I have started to use a workaround, just thought I would post it, if other people need it..(The reason I need this, is that I have to publish a lot my "scripts" to Terminal Services for regular users to use, and I am loading in a lot data from SQL, and users expect to be able to copy/paste)So I have adatapted a script from Jeffrey Hicks to start the .ps1 file instead of creating an .EXEDim objShell,objFSO,objFileSet objShell=CreateObject("WScript.Shell")Set objFSO=CreateObject("Scripting.FileSystemObject")'enter the path for your PowerShell ScriptstrPath="C:Scriptsexamplscript.ps1"'verify file existsIf objFSO.FileExists(strPath) Then'return short path name set objFile=objFSO.GetFile(strPath) strCMD="powershell -nologo -sta " & Chr(34) & "&{" &_ objFile.ShortPath & "}" & Chr(34) 'Uncomment next line for debugging 'WScript.Echo strCMD 'use 0 to hide window objShell.Run strCMD,0Else'Display error message WScript.Echo "Failed to find " & strPath WScript.Quit End If
This topic is 14 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.