Microsoft Office

Microsoft Office Questions? Ask a IT Expert for Support ASAP

Ask a Computer Expert,
Get an Answer ASAP!

Microsoft Office
This answer was rated:

I would like to have the code for creating a "save as" in a

specific file folder on my...
I would like to have the code for creating a "save as" in a specific file folder on my server. Example our user is working on a spreadsheet, when they click the button, it opens the "save as" dialogue box, and the file folder location is a default, that I have setup on the server.
Show More
Show Less
Ask Your Own Microsoft Office Question
Answered in 16 minutes by:
8/26/2013
Bryan
Bryan, Computer Enthusiast
Category: Microsoft Office
Satisfied Customers: 1,445
Experience: Have been using MS Office since Office XP and know VBA coding very well
Verified

JBryan42 :

Welcome to JustAnswer. My name is XXXXX XXXXX I will be assisting you today. Please do not rate this session until it has been completed.

JBryan42 :

Are you asking how to replicate that functionality in your own code? Or a shortcut to activate that function? I'm not exactly sure what you're asking for.

Customer :

Sorry, I thought the question was going to Richard, who has been helping me recently. Here is the scenario, I have a spreadsheet open, that has a button control "Save as". I need to have the button perform a command, that opens the "Save as" dialogue box, but instead of the default path being, where the file was originated, I need to specify a file folder on my server, where I want the spreadsheet saved. Does that make any more sense?

Customer :

I do not have the code written for this command, so if I am understanding your question, I am looking for the shortcut to activate the button.

Customer :

Sorry, I thought the question was going to Richard, who has been helping me recently. Here is the scenario, I have a spreadsheet open, that has a button control "Save as". I need to have the button perform a command, that opens the "Save as" dialogue box, but instead of the default path being, where the file was originated, I need to specify a file folder on my server, where I want the spreadsheet saved. Does that make any more sense?





5:26 PM



I do not have the code written for this command, so if I am understanding your question, I am looking for the shortcut to activate the button.



JBryan42 :

Yes, that does make perfect sense. I can give you the code, but seeing that Richard has been helping you, I would prefer to let him have your question unless he opts out. Is that okay with you?

Customer :

That would be great, thank you.

JBryan42 :

No problem at all. Take care. And if Richard needs to opt out for any reason, I'll be happy to take over for him.

Customer :

Do I need to do anything on my end, or will the question be reassigned, so he will pick up where you and I have left it?

JBryan42 :

No need for you to do anything. He will pick it up at his end and you will get an email as soon as he does.

Ask Your Own Microsoft Office Question
Rachel-Mod
Rachel-Mod, Moderator
Category: Microsoft Office
Satisfied Customers: 5
Experience: Moderator
Verified

Hello,

I'm Rachel, and I’m a moderator for this topic. I sent your requested professional a message to follow up with you here, when they are back online.

If I can help further, please let me know. Thank you for your continued patience.

Best,

Rachel

Ask Your Own Microsoft Office Question
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 41,126
Experience: Over 15 year experience resolving Microsoft Office Issues
Verified
Hi There,

The code for this is below

Sub t()


Dim IntialName As String
Dim fileSaveName As Variant

fileSaveName = Application.GetSaveAsFilename(InitialFileName:="C:\temp", _
fileFilter:="Excel Files (*.xls), *.xls")

End Sub


In my example, c:\temp is the save as location default

If you have any difficulties at all, please do not hesitate to let me know so I can assist you further

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

The code opens up the correct folder, where I want to save to, but I need to keep the same file name, as originally opened. The code provided changes the name to whatever I put in quotations.

ok, then use my code below.

You set the file name for the variable FileName

Sub JA()

Dim IntialName As String
Dim fileSaveName As Variant
InitialDrive = "c:\test\"
Filename = "test.xlsx"

fileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitialDrive & Filename, _
fileFilter:="Excel Files (*.xlsx), *.xlsx")


End Sub

Let me know if you have any difficulties please

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

I am not explaining very well. Let me try again:


Scenario: I open a file named: "Estimate_08272013.xlsm" from a folder on my local drive.


 


I make the necessary changes to the file, and then click on the command button_142


 


What I am looking for is:


1) I need to save it in a different folder, on my server - ***The code provided is doing this part**


2) I need the filename to be the same as the original "Estimate_08272013.xlsm" - ***The code as written, is currently changing the name - to a variable name, not the desired result***

Thanks,

Then use this code please

Sub JA()

Dim IntialName As String
Dim fileSaveName As Variant
Dim objClassOnly As Excel.Application

Set objClassOnly = GetObject(, "Excel.Application")

InitialDrive = "c:\test\"
Filename = objClassOnly.ActiveWorkbook.Name

fileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitialDrive & Filename, _
fileFilter:="Excel Files (*.xlsx), *.xlsx")


End Sub



Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 41,126
Experience: Over 15 year experience resolving Microsoft Office Issues
Verified
Richard and 87 other Microsoft Office Specialists are ready to help you
Ask your own question now
Customer reply replied 4 years ago

Richard,


Sorry to bother you again, on this question, but I just noticed that this is not actually saving the file. When I click on the control button, it does open the "Save as" dialoque box, and has the proper name in the file name box, but when I click "Save" it closes the dialoque box, but is not saving the file, to the specified folder, and/or any other folder, for that matter. I have checked to ensure it was not saving to a temp folder, by chance.

Is it possible to look at your file?
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago


Yes, if you will send me the link, again. Do you want me to upload the excel file?

yes, and tell me where the button is to run the code please

- Click the following link: http://www.wikisend.com
- Upload the file to that website
- Once it is uploaded, the resulting page will display a "File ID" number.
- Please, give me that "File ID Number"
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

File No. 522060

Can you tell me where the button is to run the code please
Ask Your Own Microsoft Office Question

Its ok, I found it

 

Use this version please

 

<a href="http://ge.tt/4zy37uw/v/0?c">http://ge.tt/4zy37uw/v/0?c</a>

 

Let me know if you have any difficulties please
Ask Your Own Microsoft Office Question
The editor took out some of the code, which is why I uploaded it for you.

http://ge.tt/4zy37uw/v/0?c
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago


Richard, that code works, but I have realized a different issue with the code. As mentioned above, in this thread, the user needs to be able to open an existing file (example: 10013_Joe_Doe.xltm) and then click on the control button #142 which opens the "Save As" dialoque box, and the default file name, remains the same 10013_Joe_Doe.xltm.


 


As the code is currently written, that works, but what the user needs to be able to do, is modify the file name, by only changing the number associated with it (ie. 10013), they would change the file to 13157_Joe_Doe.xltm for example. As the code is written, it does not allow you to modify that name.


 


I have attached a flow chart of how the user would open the template file, modify it and save it as a quote, and then open the quote file, and modify it, click on the control button #142, and change the number on the file name, and save it in the desired file folder. Hope this makes sense, and is possible. Thanks

ok, for this requirement,

Change the code

ActiveWorkbook.SaveAs

to

ActiveWorkbook.SaveAs fileSaveName

then it saves it as the file name the users set in the save as box.

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Richard I change the code, but receive a runtime error '1004, I have attached the screen shots below. Also, once I click on the control button, the first dialoque that comes up, is that "you cannot save a VB Project in a macro-free workbook" I noticed that the file extensions within the code, show .xlsm. I need to maintain the macro enabled workbook, when the user saves the file, but I do not want it saved as a macro-enabled template file.


You have to save it as a xlsm else it will stip out the Macros.

No way around this.

Use my version which works please

http://ge.tt/51yILvw/v/0?c


Ask Your Own Microsoft Office Question
Ask Richard Your Own Question
Richard
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 41,126
41,126 Satisfied Customers
Experience: Over 15 year experience resolving Microsoft Office Issues

Richard is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

jstinehelfer

jstinehelfer

Information Systems Manager

36 satisfied customers

A+ Comptia Certified computer repair

JasonJames122

JasonJames122

Computer Enthusiast

0 satisfied customers

I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business

Jess M.

Jess M.

Computer Support Specialist

701 satisfied customers

Computer Software Specialist for more than 10 years

The-PC-Guy

The-PC-Guy

Computer Manager

588 satisfied customers

20 years experience providing remote computer support

James K.

James K.

Consultant

260 satisfied customers

Technical Director of IT Company

IT Miro

IT Miro

Computer Scientist

157 satisfied customers

Bachelor's Degree in Information Technology, Microsoft Certified Professional

Chris L.

Chris L.

Support Specialist

147 satisfied customers

Certified Expert with over 10 years experience.

< Previous | Next >

Related Microsoft Office Questions
I have just had to reload /restore my Windows software as my
Hi, I have just had to reload /restore my Windows software as my system no longer logged onto the internet. One day to the next, it just would not show me Wifi connection details. I fixed that with th… read more
technicalcat
technicalcat
Computer Science
838 satisfied customers
I'm trying to get an IF/THEN/ELSE statement to work in a
Hi there. I'm trying to get an IF/THEN/ELSE statement to work in a mail merge. Here it is in a nutshell: … read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
I purchase a new Dell Laptop; order number 324841229;
I purchase a new Dell Laptop; order number###-##-#### Customer number###-##-#### as part off the purchase on 1/12/2018, was the software for Microsoft Office 365 personal. DE000000215429516 … read more
JJesus Perez Gonzale
JJesus Perez Gonzale
Bachelors of Science, Computer Engineering
37 satisfied customers
I just acquired 365 and now I cannot access any of my
I just acquired 365 and now I cannot access any of my documents. whatsup? … read more
Jason Jones
Jason Jones
AAS Information Technology
6,320 satisfied customers
Why thank you. I have a word document in docx stored in
Why thank you. I have a word document in docx stored in Dropbox. When I access on my iPad Pro 10.5, it's format is messed up. Was looking on the internet for some help. … read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
I just ran the latest update for microsoft office and now I
I just ran the latest update for microsoft office and now I can't see any letters when I type on a page????? … read more
Kamil Anwar
Kamil Anwar
IT Consultant / Systems Engineer
Bachelor\u0027s Degree
434 satisfied customers
It seems that a worksheet I was working on is no longer
It seems that a worksheet I was working on is no longer there. The workbook went white with small blocks at random places on the screen. I know I did not delete it. How can I recover it? It shows in t… read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
I have two MacBook pros htat I bought teo copies of Office
I have two MacBook pros htat I bought teo copies of Office home/student. My issue is my wifes mac shows my one drive since I purchased both copies. How can I get her mac to point to her own onedrive s… read more
Kamil Anwar
Kamil Anwar
IT Consultant / Systems Engineer
Bachelor\u0027s Degree
434 satisfied customers
I hit undo too many times on my mac excel sheet and now I
I hit undo too many times on my mac excel sheet and now I cannot get it to redo the changes -- I've lost all the work … read more
Richard
Richard
Software Specialist
41,126 satisfied customers
You keep on asking for a 4 digit code. I only have a 7 digit
You keep on asking for a 4 digit code. I only have a 7 digit code … read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
Help me get aa password from Microsoft 365. I am 85 and not
Please help me get aa password ***** Microsoft 365. I am 85 and not that good at solving problems… read more
Kamil Anwar
Kamil Anwar
IT Consultant / Systems Engineer
Bachelor\u0027s Degree
434 satisfied customers
My microsoft outlook express email will no longer send.
My microsoft outlook express email will no longer send. cannot find liscence # … read more
Richard
Richard
Software Specialist
41,126 satisfied customers
I got a new computer and geek squad did not put Microsoft
I got a new computer and geek squad did not put Microsoft work back into my com puter. I have the product key. How do I reinstall it … read more
Josh
Josh
It Support Specialist
Associate Degree
5,140 satisfied customers
I just complete a 50 page document in which I discover all
I just complete a 50 page document in which I discover all of the capitalized letters have changes to small letter. Is there a way to correct it without going word by word? … read more
The-PC-Guy
The-PC-Guy
Computer Manager
Bachelor's Degree
588 satisfied customers
Running Outlook 2016 on Windows 7 machine. I disabled junk
Running Outlook 2016 on Windows 7 machine. I disabled junk in the program and the registry and it is still placing critical emails in the junk folder. How do I disable?… read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
My MS 2016 stopped working. Win 10. No I haven't used it in
My MS 2016 stopped working JA: What application are you using? Customer: win 10 JA: Have you installed any updates recently? Customer: no I haven't used it in a while JA: Anything else you want the Mi… read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
Just updated the Office 16 automatically and neither of my
Just updated the Office 16 automatically and neither of my printers will print Word files. Will print when using old Office 11 program. What can I do? … read more
RussellA
RussellA
Solutions Architect
Bachelor\u0027s Degree
123 satisfied customers
Microsoft Outlook error messages: 0x8004210A. & 0x800Ccc92 I
Microsoft Outlook error messages: 0x8004210A. & 0x800Ccc92 I changed my Gmail password, causing these errors apparently. Today is my last day of membership.… read more
Kris R
Kris R
IT Manager
Computing
2,654 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x