DetachDocumentFromCell

Detaches a document from a cell.

Tip:

To attach a document to a cell, use AttachDocumentToCell. To get the names and paths of the documents attached to a cell, use GetAttachedDocumentsToCell.

Syntax

<HsvData>.DetachDocumentFromCell lScenario, lYear, lPeriod, lEntity, lParent, lValue, lAccount, lICP, lCustom1, lCustom2, lCustom3, lCustom4, bstrDocPath, bstrDocFile

Argument

Description

lScenario

Long (ByVal). The member ID of the cell's Scenario dimension member.

lYear

Long (ByVal). The member ID of the cell's Year dimension member.

lPeriod

Long (ByVal). The member ID of the cell's Period dimension member.

lEntity

Long (ByVal). The member ID of the cell's Entity dimension member.

lParent

Long (ByVal). The member ID of the parent of the lEntity argument's entity.

lValue

Long (ByVal). The member ID of the cell's Value dimension member.

lAccount

Long (ByVal). The member ID of the cell's Account dimension member.

lICP

Long (ByVal). The member ID of the cell's Intercompany Partner dimension member.

lCustom1

Long (ByVal). The member ID of the cell's Custom 1 dimension member.

lCustom2

Long (ByVal). The member ID of the cell's Custom 2 dimension member.

lCustom3

Long (ByVal). The member ID of the cell's Custom 3 dimension member.

lCustom4

Long (ByVal). The member ID of the cell's Custom 4 dimension member.

bstrDocPath

String (ByVal). The path in which the document has been loaded. Folders in the path are delimited by backslashes ( \ ).

bstrDocFile

String (ByVal). The name of the file to detach.

Caution!

This file must be loaded in the folder specified by the bstrDocPath argument, otherwise an error will be thrown.

Example

The following subroutine detaches all documents that are attached to a given cell. GetAttachedDocumentsToCell returns the names and paths of the documents to be detached.

Sub detachAllDocsFromCell(lScen As Long, lYear As Long, lPer As Long, _
   lEnt As Long, lPar As Long, lVal As Long, lAcct As Long, lIcp As _
   Long, lCust1 As Long, lCust2 As Long, lCust3 As Long, lCust4 As Long)
Dim vaPaths As Variant, vaFilenames As Variant
'g_cData is a previously set HsvData object reference
g_cData.GetAttachedDocumentsToCell lScen, lYear, lPer, lEnt, lPar, _
  lVal, lAcct, lIcp, lCust1, lCust2, lCust3, lCust4, vaPaths, vaFilenames
For i = LBound(vaPaths) To UBound(vaPaths)
  g_cData.DetachDocumentFromCell lScen, lYear, lPer, lEnt, lPar, lVal, _
     lAcct, lIcp, lCust1, lCust2, lCust3, lCust4, vaPaths(i), _ 
     vaFilenames(i)
Next i
End Sub