on 09-29-2008 7:40 AM
Hi friends,
I need to open an excel file from a sap business one form.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Or, VB code to attach to button, how read data from Excel Workbook, you can find in this thread [Import Data to UDO|;.
To simple open file:
Public Sub ManageItemEvent( _
ByVal FormUID As String, _
ByRef pVal As SAPbouiCOM.ItemEvent, _
ByRef BubbleEvent As Boolean _
) 'Handles SBO_Application.ItemEvent
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
If pVal.ItemUID.Equals("btnExcel") And Not pVal.BeforeAction Then
Call OpenExcelFile("C:TEMPmy_excel_file.xls")
BubbleEvent = False
Else
BubbleEvent = True
End If
End Select
End Sub
Private Sub OpenExcelFile(ByVal sXlsFile As String)
'Dim iRetVal As Integer
Try
Dim startInfo As New ProcessStartInfo(sXlsFile)
startInfo.WindowStyle = ProcessWindowStyle.Maximized
Process.Start(startInfo)
Catch ex As Exception
' log exception
Finally
System.GC.Collect() 'Release the handle to the table
End Try
End Sub
HTH
Sierdna S.
Edited by: Sierdna S on Sep 29, 2008 9:43 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.