runtimeFrankie
Technical User
Hi All,
I am trying to add a customdocumentproperty to store a value so my application knows which cell to enter data into a (excel) spreadsheet.
I may not be doing this the best way (I am new to this) but this is how my failed attempt is going so far:-
Dim DP As DocumentProperties
Set DP = ActiveWorkbook.CustomDocumentProperties
DP.Add Name:="CurrentRow", LinkToContent:=False, _
Type:=msoPropertyTypeNumber, Value:=3
VBA doesn't like the above (the property name already holds the name value for my form) and I get a runtime error telling me that "Method 'Add' of object 'DocumentProperties' failed" but I don't know what I am doing wrong and I can't find the answer in my book (Mastering VBA6).
Any advice would be appreciated.
Thanks in advance.
runtimeFrankie
I am trying to add a customdocumentproperty to store a value so my application knows which cell to enter data into a (excel) spreadsheet.
I may not be doing this the best way (I am new to this) but this is how my failed attempt is going so far:-
Dim DP As DocumentProperties
Set DP = ActiveWorkbook.CustomDocumentProperties
DP.Add Name:="CurrentRow", LinkToContent:=False, _
Type:=msoPropertyTypeNumber, Value:=3
VBA doesn't like the above (the property name already holds the name value for my form) and I get a runtime error telling me that "Method 'Add' of object 'DocumentProperties' failed" but I don't know what I am doing wrong and I can't find the answer in my book (Mastering VBA6).
Any advice would be appreciated.
Thanks in advance.
runtimeFrankie