View Single Post
 
Old 06-24-2023, 06:39 AM
TheBigBoss TheBigBoss is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Dec 2016
Posts: 56
TheBigBoss is on a distinguished road
Default

Hi Guessed,
Thanks for helping, sorry for that.
Let me do a last try with the file.

Same problem on my side, no access to macro.
I had to use the "Unblock a single file" in the doc properties before opening it??
a) Open Windows File Explorer and go to the folder where you saved the file.
b) Right-click the file and choose Properties from the context menu.
c) At the bottom of the General tab, select the Unblock checkbox and select OK.

If file is fine, please run "FillFields"
If not, well sorry, I will close the thread

I found a fix using this function
Code:
Function splitLineBreaks(ByVal str As String) As String
    str = Replace(str, vbCrLf, vbCr)
    str = Replace(str, vbLf, vbCr)
    splitLineBreaks = Split(str, vbCr)
End Function
In UserForm.Initialise(), look for these two lines (it appears twice as there is two bookmarks)
Code:
'dt = Split(CorNot1VenueDate, vbNewLine)
            dt = splitLineBreaks(CorNot1VenueDate)
The splitLineBreaks() function works... yet, a simple Split function at vbNewLine returns 2 for the first bookmark (this is perfectly fine) but 1 for the second bookmark (same code, same text with one hard return)??? Really puzzled why it fails?
Attached Files
File Type: docm TESTIT-SINGLEFILE.docm (103.2 KB, 4 views)
Reply With Quote