EssVSendData

Description

Updates the database with data from the specified worksheet.

This function does not work with the EssMenuVLock function.

Syntax

EssVSendData(sheetName, range)
ByVal sheetName As Variant
ByVal range As Variant

Parameters

sheetName

Text name of worksheet to operate on. sheetName is of the form "[Book.xls]Sheet". If sheetName is Null or Empty, the active worksheet is used.

range

Range object which refers to the data to be used as the source of the update. If range is Null or Empty, the whole worksheet is used.

Return Value

Returns 0 if successful. A negative number indicates a local failure (see VBA Return Values). A return value greater than zero indicates a failure on the server.

Example

Declare Function EssVRetrieve Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal range As Variant, ByVal lockFlag As Variant) As Long

Declare Function EssVSendData Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal range As Variant) As Long

Declare Function EssVUnlock Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant) As Long

Sub SendData()
X=EssVRetrieve("[Book2.xls]Sheet1", RANGE("A1:F12"), 3)
If X = 0 Then
   MsgBox("Lock successful.")
   Y=EssVSendData("[Book2.xls]Sheet1", RANGE("A1:F12"))
   If Y = 0 Then
      MsgBox("Send successful.")
   Else
      MsgBox("Send failed. Unlocking data.")
      Z=EssVUnlock("[Book2.xls]Sheet1")
      If Z = 0 Then
         MsgBox("Data unlocked. Try again.")
      Else
         MsgBox("Data not unlocked. Try again.")
      End If
   End If
Else
   MsgBox("Lock failed. Cannot send data.")
End If
End Sub

Note:

To update data on the server, you need at least Write access to the database.