Problem with filepath

Desmondo

Board Regular
Joined
Feb 27, 2013
Messages
70
I have created a tool which generates letters from a userform. The structure of my directory is app main folder and within this there is two folders one called templates and one called archive and the main xlsm file is there to.

I am trying to create the filepaths so that no matter where the main folder is it can detect the path rather than using a constant file path and having to update that all the time.

I am trying to assign the path of where the xlsm file is to the var aPPPath & append with the directory Archive and the folder my app creates so that i can save my docs there.

I am appending like so but think its wrong

Code:
aPPPath = Application.ActiveWorkbook.Path & "\" & Archive & "\" & strFolderName & "\"

Can anyone highlight the errors of my ways also when i run MsgBox i get the saving to the following path C:\Users\desmo\Desktop\32\& name of folder i have no idea where the 32 is coming from as it should read C:\Users\desmo\Desktop\Dashboard\Archive\& Foldername.


Problem solved guys missed the double quotes on Archive
 
Last edited:

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Tip: include an Option Explicit directive at the start of every code module. This will highlight instances where VBA thinks you've used a variable - in this case Archive - which hasn't been declared.
 
Upvote 0

Forum statistics

Threads
1,217,382
Messages
6,136,234
Members
450,000
Latest member
jgp19

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