Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- objExcel = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")
- Set wsh = VBA.CreateObject("WScript.Shell")
- arg = ActiveWorkbook.Path & ";" & ActiveWorkbook.Name & ";" & ActiveSheet.Name & ";" & Target.Address
- ' Wait for the shelled application to finish:
- errorCode = wsh.Run(strPathDatePicker & " " & arg, windowStyle, waitOnReturn)
- Public Sub frmDatePicker_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Dim Par() As String
- Dim strTemp As String
- Try
- Dim arg = Environment.GetCommandLineArgs
- strTemp = arg(1)
- Par = Split(strTemp, ";")
- 'Split arg, to get the Information from the Excel Workbook
- strWbPath = Par(0)
- strWbName = Par(1)
- strWsName = Par(2)
- strAdresse = Par(3)
- Catch ex As Exception
- Me.Close()
- End Try
- End Sub
- Private Sub MonthCalendar1_DateSelected(sender As Object, e As DateRangeEventArgs) Handles MonthCalendar1.DateSelected
- Dim objExcel As Excel.Application
- Dim wb As Excel.Workbook
- Dim ws As Excel.Worksheet
- Try
- 'Get the Excel Object
- objExcel = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")
- For Each wb In objExcel.Workbooks
- If wb.Name = strWbName Then
- ws = wb.Sheets(strWsName)
- ws.Range(strAdresse.ToString).Value = e.Start()
- Me.Close()
- End If
- Next
- Catch ex As Exception
- MessageBox.Show(ex.Message)
- Me.Close()
- End Try
- End Sub
- Dim o As Object = GetObject("Book 1.xls")
- Dim wb As Excel.Workbook = TryCast(o, Excel.Workbook)
- arg = ActiveWorkbook.Path & ";" & ActiveWorkbook.Name & ";" & ActiveSheet.Name & ";" & Target.Address
- arg = ThisWorkbook.Path & ";" & ThisWorkbook.Name & ";" & ActiveSheet.Name & ";" & Target.Address
Add Comment
Please, Sign In to add comment