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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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