EditFromClipboard problem

 

Hi,

    I was trying to insert excel link to existing variable in solidedge part file.

I am trying to dynamically copy from cell and use EditFromClipboard() function to paste it into variable table.

I'm getting "Parameter is incorrect " error.

Code is as follows :          objworksheet.Cells(j, "B") = keys(i).ToString

 

                        objworksheet.Cells(j, "C").Copy()

 

                        ObjVars.EditFromClipboard(keys(i).ToString)

 

 

Posted by: Mithun **bleep**ole
Post date: 3/1/2009 7:02:57 PM

1 REPLY

RE: EditFromClipboard problem

 

The Solid Edge SDK offers this example.  See if it helps.Private Sub Form_Load() Dim objApp As SolidEdgeFramework.Application Dim objDoc As SolidEdgePart.PartDocument Dim objVars As SolidEdgeFramework.Variables Dim objVar1 As SolidEdgeFramework.variable Dim objXLS As Excel.Workbook Dim objSheet As Excel.Worksheet Dim objCell As Excel.Range Const XLS_FILE = "T:\vbtests\testcases\Variables.xls" ' Report errors Const PI = 3.14159265358979 ' Create/get the application with specific settings On Error Resume Next Set objApp = GetObject(, "SolidEdge.Application") If Err Then Err.Clear Set objApp = CreateObject("SolidEdge.Application") Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument") objApp.Visible = True Else Set objDoc = objApp.ActiveDocument End If 'Get the Varialbes collection Set objVars = objDoc.Variables 'Create a variable Set objVar1 = objVars.Add(pName:="Length", pFormula:="1.0 in") 'Set the variables formula to someThing else objVar1.Formula = "2*1.5 " 'Open the XLS application and the XLS file and copy the cell into ClipBoard Set objXLS = GetObject(XLS_FILE) Set objSheet = objXLS.ActiveSheet Set objCell = objSheet.Cells(2, 2) Call objCell.Copy 'Edit the variable Formula to be linked to the XLS cell Call objVars.EditFromClipboard(pName:="Length") objXLS.Close False ' USER DISPLAY ' Release objects Set objApp = Nothing Set objDoc = Nothing Set objVars = Nothing Set objVar1 = Nothing Set objXLS = Nothing Set objSheet = Nothing Set objCell = NothingEnd Sub

 

Posted by: Jason Newell
Post date: 3/3/2009 6:35:18 AM