J
jennifer.mezger
I am having difficulty assigning a string to the Value Column of a
User Defined Cell. I am trying to create a MACRO which will ask the
user to input text information into a form and then add that text to
the DOCUMENT level User Defined Cell (Value Column). I know the
column can take string because I can enter the text manually
("string"). I am setting the value of the form's text field to a
variable (As String) and then trying to set the cell's formula to the
variable. I get a runtime error saying "#NAME?". Here is my code:
Dim clienttext As String
Dim projecttext As String
Dim UndoScopeID1 As Long
clienttext = ClientTextBox.Text
projecttext = ProjectTextBox.Text
'Insert row and enter data
UndoScopeID1 = Application.BeginUndoScope("Insert Row")
Application.ActiveWindow.Shape.AddRow visSectionUser, 0,
visTagDefault
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserValue).FormulaForceU = "0"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserPrompt).FormulaForceU = """"""
Application.EndUndoScope UndoScopeID1, True
'Client Name
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserValue).RowNameU = "ClientName"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserValue).FormulaU = clienttext
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserPrompt).FormulaU = ""
'Insert Row and enter data
UndoScopeID1 = Application.BeginUndoScope("Insert Row")
Application.ActiveWindow.Shape.AddRow visSectionUser, 0,
visTagDefault
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserValue).FormulaForceU = "0"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserPrompt).FormulaForceU = """"""
Application.EndUndoScope UndoScopeID1, True
'Project Name
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserValue).RowNameU = "ProjectName"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserValue).FormulaU = projecttext
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserPrompt).FormulaU = ""
Any ideas on how to get this to work?
User Defined Cell. I am trying to create a MACRO which will ask the
user to input text information into a form and then add that text to
the DOCUMENT level User Defined Cell (Value Column). I know the
column can take string because I can enter the text manually
("string"). I am setting the value of the form's text field to a
variable (As String) and then trying to set the cell's formula to the
variable. I get a runtime error saying "#NAME?". Here is my code:
Dim clienttext As String
Dim projecttext As String
Dim UndoScopeID1 As Long
clienttext = ClientTextBox.Text
projecttext = ProjectTextBox.Text
'Insert row and enter data
UndoScopeID1 = Application.BeginUndoScope("Insert Row")
Application.ActiveWindow.Shape.AddRow visSectionUser, 0,
visTagDefault
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserValue).FormulaForceU = "0"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserPrompt).FormulaForceU = """"""
Application.EndUndoScope UndoScopeID1, True
'Client Name
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserValue).RowNameU = "ClientName"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserValue).FormulaU = clienttext
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 2,
visUserPrompt).FormulaU = ""
'Insert Row and enter data
UndoScopeID1 = Application.BeginUndoScope("Insert Row")
Application.ActiveWindow.Shape.AddRow visSectionUser, 0,
visTagDefault
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserValue).FormulaForceU = "0"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserPrompt).FormulaForceU = """"""
Application.EndUndoScope UndoScopeID1, True
'Project Name
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserValue).RowNameU = "ProjectName"
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserValue).FormulaU = projecttext
Application.ActiveWindow.Shape.CellsSRC(visSectionUser, 3,
visUserPrompt).FormulaU = ""
Any ideas on how to get this to work?