xlApp.Run “SetparentForm”, Me
while executing the above line in the Windows XP,we are getting error Macro “Setparentform” not found.
But the same piece of code gets executed in the NT machine.
SetParentForm is property in the excel vba.
The macro call works fine the very first time and will not work later….
help is appreciated..!
Private Sub cmdAddWorkup_Click()
Dim onode As Node
Dim sFilename As String
Dim pbText() As Byte
Dim stempfile As String
Dim lFile As Long
Dim iRet As Integer
Dim xlAddIn As Excel.AddIn
On Error GoTo ErrorHandler
Const SFUNCNAME = “cmdAddWorkup_Click”
Screen.MousePointer = vbHourglass
‘open what he selects from the list view
Set onode = tvwWorkup.Nodes(tvwWorkup.SelectedItem.Index)
If onode.Tag = “SUBDIR” Or onode.Tag = “ROOT” Then
Screen.MousePointer = vbNormal
MsgBox “Select a valid Workup spreadsheet to add.”, vbExclamation
Exit Sub
End If
Set xlApp = New Excel.Application
‘edit the workup
If poWorkupAttachments.icount > 0 Then
Screen.MousePointer = vbNormal
iRet = MsgBox(“Do you want to overwrite the existing Workup spreadsheet?”, vbQuestion + vbYesNo, “AIQUIC”)
If iRet = vbYes Then
Set oWorkupAttachment = poWorkupAttachments.oList(1)
poWorkupAttachments.MarkasExisting
Else
Exit Sub
End If
Else
poWorkupAttachments.MarkAsNew
End If
sFilename = onode.Tag & onode.Text
‘ inserted by Shankar
‘ Set xlBook = Nothing
Set xlBook = xlApp.Workbooks.Open(Filename:=sFilename, ReadOnly:=False)
‘ inserted by Shankar
‘ Set xlAddIn = Nothing
‘install the add-in application
Set xlAddIn = xlApp.AddIns.Add(Filename:=App.Path & “\” & “Test.XLA”)
xlAddIn.Installed = True
xlApp.Run “SetparentForm”, Me