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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top