Mrsbex
New Member
- Joined
- Dec 5, 2017
- Messages
- 12
Can any of you clever people out there help me please? I have reached the end of my tether...
I have this code to try and save a workbook as an XLS file to folder in Dropbox using text from the worksheet as a filename. I had it running beautifully on Macs but we are now moving over to PCs and of course the macro is not working...
When I run it, it tries to apply the Dropbox path twice and loses the end of it too...
The error message I am getting, on my PC for instance, is...
Run-time error '1004':
Microsoft Excel cannot access the file 'C:\Users\Beckey_2\Dropbox\OPERATIONS\Phone Orders\%USERPROFILE%\Dropbox\OPERATIONS\'.
I have tried putting in a ChDir line:
but then I get:
Run-time error '76':
"Path not found" error message.
What can I do to fix this?
Thanks in advance,
Beckey.
I have this code to try and save a workbook as an XLS file to folder in Dropbox using text from the worksheet as a filename. I had it running beautifully on Macs but we are now moving over to PCs and of course the macro is not working...
Code:
Sub SaveIt()
Dim FName As String
FName = ActiveWorkbook.Sheets("Data").Range("D2").Value
ActiveWorkbook.SaveAs Filename:="%USERPROFILE%\Dropbox\OPERATIONS\Phone Orders" & FName & ".xls", FileFormat:=xlExcel8
End Sub
When I run it, it tries to apply the Dropbox path twice and loses the end of it too...
The error message I am getting, on my PC for instance, is...
Run-time error '1004':
Microsoft Excel cannot access the file 'C:\Users\Beckey_2\Dropbox\OPERATIONS\Phone Orders\%USERPROFILE%\Dropbox\OPERATIONS\'.
I have tried putting in a ChDir line:
Code:
ChDir "%USERPROFILE%\Dropbox\OPERATIONS\Phone Orders
Run-time error '76':
"Path not found" error message.
What can I do to fix this?
Thanks in advance,
Beckey.