Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Change ThisWorkBook.Path direction

Posted on 2013-01-30
3
Medium Priority
?
403 Views
Last Modified: 2013-02-02
The code snippet below directs a new workbook to c:\tmp

If Dir(ThisWorkbook.Path & "\" & "new.xlsx") = "" Then
        xBook.SaveAs Filename:=ThisWorkbook.Path & "\" & ThisWorkbook.Name & "_" & Format(Now(), "yyyymmdd_hhnnss") & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    Else
        xBook.SaveAs Filename:=ThisWorkbook.Path & "\" & "new.xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    End If

How would this be altered to go to D:\My Documents (windows environment)

And the equivalent in the MAC OS. I don't use MAC and not sure if there is a common directory for docs.

Thanks in advance for any suggestions
0
Comment
Question by:dgd1212
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 49

Assisted Solution

by:Martin Liss
Martin Liss earned 400 total points
ID: 38837918
On the MAC the directory is 'Documents'.
0
 
LVL 2

Accepted Solution

by:
junholee earned 1600 total points
ID: 38838344
0
 

Author Comment

by:dgd1212
ID: 38847207
maybe I am misunderstanding the solution. once the second Workbook is created it should be filed into "My Documents". I'm making the assumption that "My Documents" is the same for XP, and windows 7/8. Not sure how the code should be written to accomplish. Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question