What the "&amp" is this??

Dr. Demento

Well-known Member
Joined
Nov 2, 2010
Messages
618
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I'm looking to use a function by Jon Peltier on DDoE, but I get the dreaded red text on the highlighted line below:
Code:
Private Declare Function lstrlenW Lib “kernel32″ _
     (ByVal lpString As Long) As Long

Private Declare Function SHGetFolderPath Lib “shfolder.dll” _
     Alias “SHGetFolderPathA” _
     (ByVal hwndOwner As Long, _
     ByVal nFolder As Long, _
     ByVal hToken As Long, _
     ByVal dwReserved As Long, _
     ByVal lpszPath As String) As Long

Function MyDocumentsDir()
     Dim sBuffer As String
     sBuffer = Space$(260)
     [B][COLOR="#FF0000"]If SHGetFolderPath(&H0, &H5, -1, &H0, sBuffer) = 0 Then[/COLOR][/B]
         MyDocumentsDir = Left$(sBuffer, lstrlenW(StrPtr(sBuffer)))
     End If
End Function

I saw that &amp is used in HTML; is that what happened here - HTML encoding "corrupted" Jon's entry or am I doing something else wrong.

It's too early!!

Thanks, y'all.

Follow-up: Never mind; Peter Thornton answered it in the comments section "(ignore any “amp;” that might creep in before the “H”)"
 
Last edited:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,214,528
Messages
6,120,065
Members
448,941
Latest member
AlphaRino

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top