Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: David L.   on Oct 30 In MS Office Category.

  
Question Answered By: Adalricus Fischer   on Oct 30

I think your terminology is inconsistent.
Or at least confusing.
You've posted a question to an Excel VBA group.
Which would imply that you wish a solution using VBA in Excel.
Yet you mentioned using a "command line", which generally refers to
the command  issued to LAUNCH an application (like MSExcel), not
something WITHIN Excel.

I guess if we knew your PURPOSE, we can help.
My boss learned some time ago that if he asks me for something, I'll
give him exactly what he asks for. Even though he doesn't know what
he's talking about and ends up getting something does not serve his
purpose. He's learned that he needs to tell me what he wants to
accomplish, and I'll provide a solution.

Putting all of this together, Are you trying to provide a file  that,
when opened, saves itself (with the same name) in a local folder (or
user's personal folder), then remains open?

If so, you can use:
Option Explicit
Sub auto_open()
Dim TempPath
TempPath = "C:\temp\"
ActiveWorkbook.SaveAs (TempPath & ActiveWorkbook.Name)
End Sub
If you're wanting to save  a COPY, but stay in the original file,
look at SaveCopyAs.
If you want to make sure the existing file (in the temp folder) is
overwritten, you'll have to set up a filesystemobject, use fileexists
and delete to remove it first.

If you'll provide a bit more by way of explanation, I'm sure you can
get the help you need.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on To capture File name Or get search suggestion and latest updates.


Tagged: