In an Excel template file, can I set the Folder Path in the SaveAs Dialog box?

I have an Excel template file (xltm) and, with help from the forum, I now have a Workbook_BeforeSave subroutine to save the template as a macro enabled file (xlsm).  I’m so thankful for that help from Edward in the forum.
I also want to set the default folder location to save the file. I really only need it when the template is saved as a new xlsm file, because if they open the xlsm file, it’s usually opened from the default folder path so any save would normally go back
to where the file was opened.  However, with a template (even if the template is in the default folder) the Saved template reverts back to the user’s documents folder.
Is there a good way to do this?
I tried to modify the Workbook_BeforeSave code like this:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim FolderDir As String
Dim FileNameVal As String
FolderDir = "Z:\save\data\place\"
If SaveAsUI Then
If Dir(WorkBookFolder, vbDirectory) <> "" Then
Application.DefaultFilePath = WorkBookFolder
End If
FileNameVal = Application.GetSaveAsFilename(, "Excel Macro-Enabled Workbook (*.xlsm), *.xlsm")
Cancel = True
If FileNameVal = "False" Then 'User pressed cancel
Exit Sub
End If
ThisWorkbook.SaveAs Filename:=FileNameVal & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.EnableEvents = True
End If
End Sub
But there are a lot of checks that would need to be done.
I'm not sure how to only default the folder saved only when they open the template, but not change it when they just open an already saved Excel file created by the template (with all the active content, macros, etc.).
Alan Edwards

Hi Alan,
store the path\filename in the 1st argument:
FileNameVal = Application.GetSaveAsFilename("C:\*.xlsm", "Excel Macro-Enabled Workbook (*.xlsm), *.xlsm")
Andreas.

Similar Messages

  • Crystal Report with text(csv) data file, can we set it as input param? C#

    Hi,
    I am new to the forums and posted a question which belonged to the .net - SAP Crystal reports group.
    Can someone help me with my problem? following is the thread that I have started.
    Crystal Report with text(csv) data file, can we set it as input parameter?
    Thank you in advance.

    Looking at the original thread, you are connecting to the text file via the DAO database engine:
    "I added the text file as follow, new connection -> Access/Excell (DAO) -> select the file and the database type as text"
    Thus I would use the same code for changing the text file as for changing an Access database. See Kbase [1218178 - Error: "Logon failed" when connecting to Access database in .NET application|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333133373338%7D.do] for more information. If that does not work, you may want to consider connecting via ODBC or feeding the data from the text file to and ADO .NET dataset and pointing the report at the dataset.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to upload an excel template file to SAP server

    Dear Experts,
    I am develpoing a program to generate the Excel file with a fixed template and save it to user's local drive, the excel template is stored in SAP server. I use the function module C13Z_FILE_DOWNLOAD_BINARY to do this is. But now my problem is I do not know how to upload the excel template to our SAP server. Do any friends can kindly tell me how to upload the excel template to SAP server?? Thanks.
    Best Regards
    Joe

    Hi Joe,
    Please refer following sample program:
    http://abapcode.blogspot.com/2007/06/sample-program-to-upload-excel-document.html
    Best regards,
    Prashant

  • Crystal Report with text(csv) data file, can we set it as input parameter?

    Hi,
    I am a new user of Crystal Reports 2008.
    I have created a report with charts in it. The input data comes from a csv text file.
    Can I set the name of this text file as an input parameter?
    as I need to generate 44 similar reports with different text filenames(and data)?
    Thank you.
    Regards

    Brian,
    Thanks much.
    I did exactly what you said.
    Just to see any change, I first gave a bad report file name just to see if I am accidentally pointing to a different file,
    but I got an error saying report not found.
    Then I renamed my original datafile name and generated a report and it still generated one without giving an error.
    Then I also gave a junk name to the logoninfo and printed that name, the new name was assigned to logoninfo, but the code did not error out.
    It ended up generating the report.
    Now here is what I think is happening,
    1) The save data in report option seems to be still on even though I have turned it off in 2 locations
    a) file -> Report Options
    b) file -> Options -> Reporting tab.
    2) For some reason the logoninfo is getting ignored as well.
    Since I did not see any answers yesterday I posted a link to this thread on the .Net forum
    Crystal Report with text(csv) data file, can we set it as input param? C#
    and Ludek Uher says that I am connecting to the text file via a DAO database engine and so need to use the same code for changing the text file as for changing an Access database.
    But the link he gave me tells me to try the same thing that we have been trying..
    Here is my plan,
    1) I will first try and find out why my save data with report option is still on ( but it shows off in Crystal ).
    2) why is LogonInfo getting ignored.
    Meanwhile any suggestions from anyone are welcome.

  • Photoshop CC 2014 - The file can not be saved in path because an error has occurred

    Hello,
    I need again help regarding this issue. Sometimes but very often I receive an error, trying to save a PSD file, the error is: "The file can not be saved in <path> because an error has occurred". After that it is not possible to save the file in any format, using save or save in dialog. The only way to rescue the result is, to save for web as an jpeg. This error occours often using Topaz or NIK filter and until now only in PS-CC 2014. My workflow looks like this:
    - Open NEF RAW file in Brdige
    - Settings in ACR and give it into PS by clicking OK in ACR
    - In PS doing a adjust some levels
    - press SHIFT+STRG+ALT+E for a new summary layer
    - Uing Topaz Adjust on the new level with 65% opacity
    - press SHIFT+STRG+ALT+E for a new summary layer
    - Using Topaz DeNoise on the new layer
    - pres STRG+i and resize the image to 1200x797
    - Using Topaz InFocus on the same layer as DeNoise
    - create a vignette with brightness adjustlayer
    After this workflow in nearly 90% it is not possible to save the file as PSD or something else, only to save for web as JPG. If I save the file after opening the RAW in PS and after every layer with Topaz Filter, I can save the file when I am done. Same issue occurs using NIK Filters in that way.
    I tried to optimize the performance by using this guide: http://helpx.adobe.com/photoshop/kb/optimize-performance-photoshop-cs4-cs5.html doesn’t solve the issue.
    I re- and installed all Adobe Products more than three times, doesn't solve the issu.
    After that I ordered a new SSD drive and insall Windows 7 64bit inkl. All latest hotfixes, patches and drivers. I downloaded the newest Adobe Versions and the newest filter sets from Topaz and NIK. Doesn’t solve the issue.
    This is my rig:
    Gigabyte Z87X-UD4H mainboard
    Intel Core i7 4770k
    32GB Corsair RAM
    250GB Samsung 840 Evo SSD Drive
    nVidia Geforce GTX770
    During my tests I took the same RAW File and created nearly 20 adjustment layers and summary layers, without using Topaz or NIK filters. No problem, I was able to save the file as PSD file. 
    From my point of view, actually, the error occurs only when I am using Topaz or NIK filters. Both supports doesn’t know the issue and if I search the web, I can’t find more then me. It seemed to depend on my settings, my rig or something else, perhaps a cache is overflowed or something like this. Adobe telephone support can’t help because I said I use a third party filter. But it occurs with two different manufactures…
    So please guys, help me to figure out why this error occurs in my system.
    Thanks in Advance and best regards,
      Michael

    Update: I tried several times to reproduce the error, actually it dosen't occur. I changed nothing on my system, without reboot it twice. This is what I said in my beginning times: it occurs sometimes but often. I will keep you up to date.

  • Can I set Acrobat X to increase the proportion of my PC's RAM it uses?

    Can I set Acrobat X to increase the proportion of my PC's RAM it uses, in order to speed up OCR processing?  Currently, it uses up to 25% of my PC's RAM when OCR processing but I would like to increase this in order to complete OCR jobs more quickly.

    Short answer: no.
    Long answer: a very few programs can use multiple cores. To do this, they have to split up and run themselves as multiple separate programs (in effect). This is only really suitable when either
    (a) two entirely different things need to be done or
    (b) a job can be split up into a lot of identical jobs, and all done at the same time.
    Photo editing and video editing are the obvious cases of (b), since they have to repeat the same stuff over each bit of a picture, and a picture could be done in slices. Making programs run on multiple cores is awesomely complicated (especially if they previously didn't) but it's no coincidence that Adobe Photoshop and (I think) Adobe Premiere Pro - being image and video editors - are out there using multiple cores.
    OCR doesn't lend itself to this terribly well (since the entire page is context), but what could work well is a program which is designed to do OCR on multiple files; it could split up and do them at the same time. Acrobat isn't that kind of high end program, however, it's meant for desktop users doing one thing at a time.

  • After the update the new version can not determine downloads folder. In the eyes determine folder, however downlload files go in C / documets and settings even

    After the update the new version can not determine downloads folder. In the eyes determine folder, however downlload files go in C / documets and settings even though I chose a different folder

    hello, there's a general regression in firefox 27 that won't allow files to download directly into a root drive. please try to create a subfolder (like ''D:\Downloads'') and set this as default location for downloads...
    also see [https://bugzilla.mozilla.org/show_bug.cgi?id=958899 bug #958899].

  • How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    Phone A = phone with information you want duplicated
    Phone B = phone that you want to copy from A
    Backup Phone A.
    Wipe Phone B using these instructions. What to do before selling or giving away your iPhone, iPad, or iPod touch - Apple Support
    Phone B should be on the 'Hello' screen. Do not swipe it. Launch iTunes. Plug in Phone B.
    When iTunes asks if you want to set up as new phone or restore from backup, choose restore from backup of Phone A.
    After this setup, any changes to one phone (i.e. adding a contact, downloading an app) will have to be manually duplicated on the second phone, if that is your desire). Making changes to one phone will not affect the other after setup.

  • HT4759 I now have my daughters iPad can you please tell me why I can't set up iCloud.in settings the iCloud is greyed out also how do I change her mail account to mine?

    I now have my daughters iPad can you please tell me why I can't set up iCloud.in settings the iCloud is greyed out also how do I change her mail account to mine?

    To change your iCloud ID or password you have to go to Settings>iCloud, tap Delete Account, then sign back in with your other ID.  If you need to migrate any of your daughter's iCloud data to your account, choose Keep on My iPad when prompted, then choose Merge to upload it to the new account.  If not, choose Delete from My iPad.

  • Can i set up my ipad in the same itouch account?

    can i set my new ipad in the same account/place where i currently have my itouch set up? will this affect what i currently have in my itouch or will it see the difference when i connect my ipad and itouch? thank you

    You can use the same account and iTunes library with both - iTunes will recognise that it's a different device and you can then chose what to sync or not to sync. I use my iPad, iPhone, and iPod Touch on the same computer without any problem.

  • I'm running iTunes 10.5 on my Macbook Pro and software 4.1 on my 2g iPod touch and having problems getting photo's to sync. Same error iPod can't be synced req'd file can't be found. Tried deleting the photo cache, restoring the iPod etc but to no avail.

    I'm running iTunes 10.5 on my Macbook Pro and software 4.1 on my 2g iPod touch and having problems getting photo's to sync. Same error, "iPod can't be synced req'd file can't be found". Tried deleting the photo cache, restoring the iPod etc but to no avail.

    Try here:
    iTunes: Unable to sync photos
    Usually deleting the iPod Photo Cache Folder works. Note that if you sync via the folder method, make sure you dlete all the ifolders since :
    The iPod Photo Cache stores the photos that are optimized for display on your iPod, iPad, or iPhone. The location of this folder depends on the syncing options you select. In iTunes, if you change the selection in the “Sync Photos From” pop-up menu, a new iPod Photo Cache folder will be created (and the previous folder will remain).

  • Can we set a default value for the container variable in BPM?

    Can we set a default value for the container variable.?
    Suppose if i have a loop step and i have given a container variable i=5 as end condition.What value will it take during its first execution?Can we set the value for container before a recieve step?

    Hi
    Define Container Variable of Type integer and Category Simple Type .Use Condtion in Loop.
    In Container Operation Step Assign value and Use Expression to
    Increase or Decrease Valus according to your operation.
    look Pattern 4 in this blog to understand Container Operation
    /people/sharathchandra.girmaji/blog/2008/09/11/bpm-with-patterns-explained-part-1

  • HT201413 I am receiving a message saying the iPod "TRACER's iPod" can not be synched. The required file can not be found. I ran the iTunes program repair and restarted both the computer and the iPod. Any suggestions on what else to try?

    I am receiving a message saying the iPod "TRACER's iPod" can not be synched. The required file can not be found. I ran the iTunes program repair and restarted both the computer and the iPod. but still receive the same message. Any suggestions on what else to try?

    That can sometimes be caused by a damaged ipod photo cache.
    If you remove the current ipod photo cache, does that get you past the error?
    For instructions on where to find it, see the following document:
    iTunes: Understanding the iPod Photo Cache folder

  • When I open iMovie, the app searches for missing iPhoto files.  These are files I deleted.  I have to close about 30 dialog boxes before I can start using iMovie.  How do I make this stop?

    When I open iMovie (09), the app searches for missing iPhoto files.  These are files I deleted.  I have to close about 30 dialog boxes before I can start using iMovie.  How do I make this stop?

    So it seems the issue is when iMovie is wanting to creat thumbnails, if I ask it to ignore then it's fine but if not it hangs up searching for the video file.

  • Trying to launch another profile, get: "Impossible to find the executable file. To fix this, set a valid path in the options window"

    When I try to launch another profile in firefox, I get this message: [JavaScript Application] Impossible to find the executable file. To fix this, set a valid path in the options window.

    Having this problem with FF21 Beta1, add-on version 1.5.0.2 on Win7 immediately after upgrading FF.
    I would try to make a shortcut to the other profile as you suggested, but I honestly don't even know where the file is, if its a separate config or another executable all together.

Maybe you are looking for

  • In ALV Report ,a field to allow the user EDIT/CHANGE

    Hi Guys, My requirement is in the ALV Grid display iam having 10 fields.5th field should be allow the user EDIT/CHANGE mode. what ever he enters the value the same should be updated to an custom table. EX. o/p: 0001   0002   0003   0004   0005   0006

  • Array of strings strict type def not updating

    I have defined an Array of Strings (ctrl) as a strict type def. When I update this array (add another string to it) the values don't update where this control is used. Can someone please explain why this is occuring.

  • No implementing class registered for the interface

    Hello, I know that I'm not the first one posting this problem, but I can't find an appropriate solution for my problem. When I execute the FlightSeatAvailabilityCheck scenario I got the following error: Unable to check flight availability.        Err

  • Why Are My Fonts and Imported Photos Pixelated in Photoshop?

    It is so strange. I worked on a Photoshop document earlier today. I imported a photo and wrote text on it. When I printed it, it came out perfect. Then I started a new document. I imported a photo which is 2400 pixels wide. The document size is only

  • Consignment Settlement(MRKO) Problem

    Hi, For consignment stocks, after GR from PO, we'll either do a mvt:211K to cost ctr or mvt:411K to inventory. Now this will create a settlement entry in MRKO based on the existing PIR(purchase info record) unit price. After 6 months, vendor sends th