Error on Macro code line change

K

K

Hi all, I have code line (see below) in my macro

Const AN As String = "C:\My Documents\Pic\AN.jpg"

I want to change this above line into the code line (see below) but I
get error message with the below code line. Please can any friend can
tell that what I am doing wrong.

Const AN As String = Thisworkbook.path & "\AN.jpg"
 
B

Bob Phillips

Just declare it as variable

Dim AN As String

An = Thisworkbook.path & "\AN.jpg"
 
Top