• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA script to save an excel file in a particular map (or desktop) [SOLVED]

Dear all,


I've created a VBA script which allows me to save a file with time and datestamp. I however would also like to create something through which I can save an excel file to a particular map on my desktop.


So I could just press a macro and then the xls file will be saved in map "Excel files" on my desktop.


Anybody a VBA sample for that?


Dear regards,


Marc
 
Hi Mark


I would go about it slightly differently to achieve the same result.


Go to the Desktop - create a shortcut to the folder you want to save to and do something like this.

[pre]
Code:
Option Explicit
Sub testo()
Const Path = "C:UsersHYMCExcelHelpingHireHelpJoe"
ThisWorkbook.SaveAs Path & "IGotya2.xls"
End Sub
[/pre]

Change the path to suit.


Take care


Smallman
 
To get desktop using code:

[pre]
Code:
Sub SavetoDesktop()
ThisWorkbook.SaveAs CreateObject("WScript.Shell").SpecialFolders("Desktop") & "IGotya2.xls", xlExcel8
End Sub
[/pre]
 
Back
Top