Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Programing Help Needed

I posted this question once before but asked the wrong question..

I am trying to change the Save As directory once a file is open so that
the user automaticly saves the file to a different directory than the
one they opened it in.

I am pulling a form from a document libary. The form then has to be
saved as a different name by the user to another directory. Each form
is saved as a different name by the user so I can not use the VBA code
to save worksheet as.

Is there any way to change the home directory for document once it has
been opened.


Thanks
Steve

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Programing Help Needed

No that is not possible because it is a property of the workbook, and trying
to save elsewhere requires SaveAs.

You could always move it before opening it

Dim sOldName As String
Dim sNewName As String

sOldName = "C:\myTest\18.xls"
sNewName = "C:\19.xls"

Name sOldName As sNewName

Workbooks.Open "C:\19.xls"

but any directoreis being moved to must already exist, or else you need to
create them.

Whjy can't you use SaveAs though, you can get the username with

Environ("UserName")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"smonczka" wrote in message
oups.com...
I posted this question once before but asked the wrong question..

I am trying to change the Save As directory once a file is open so that
the user automaticly saves the file to a different directory than the
one they opened it in.

I am pulling a form from a document libary. The form then has to be
saved as a different name by the user to another directory. Each form
is saved as a different name by the user so I can not use the VBA code
to save worksheet as.

Is there any way to change the home directory for document once it has
been opened.


Thanks
Steve



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programing Help Needed

Only by doing a saveas to the directory.

you can change the default file location, but the user will have to use
SaveAs and not just Save.

chDrive "C"
chDir "C:\MyFolder"

--
Regards,
Tom Ogilvy

"smonczka" wrote in message
oups.com...
I posted this question once before but asked the wrong question..

I am trying to change the Save As directory once a file is open so that
the user automaticly saves the file to a different directory than the
one they opened it in.

I am pulling a form from a document libary. The form then has to be
saved as a different name by the user to another directory. Each form
is saved as a different name by the user so I can not use the VBA code
to save worksheet as.

Is there any way to change the home directory for document once it has
been opened.


Thanks
Steve



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Programing Help Needed

The problem with using SaveAs is that I'm pulling the form from a WSS
document library, it's a quote form.

The user opens up a custom contact database application, locates the
clients name and then selects a "make quote" button from within the
application. Once they do this .net calls the excel form from the WSS
directory and populates it with the contact information.

Problem is when the form is saved by the user the default directory is
\document library\forms, cause that where the form was pulled from.
Meaning the user has to manual change the directory to \document
library. LOL Like that is going to happen.

If i use a SaveAs statement in an OnOpen macro the document will be
saved in the proper directory but it bypasses Sharepoints MetaData
which is colected by the document libary from the user when the
document is saved. Any type of SaveAs will automaticly bypass this
request to input the MetaData.

Sorry about being long winded, but I hope that makes it clearer.

Thanks
Steve

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Programing Help Needed

I have no idea what you are talking about, but I will take your word for it
:-).

So does the other suggestion not do it for you either?

Bob


"smonczka" wrote in message
oups.com...
The problem with using SaveAs is that I'm pulling the form from a WSS
document library, it's a quote form.

The user opens up a custom contact database application, locates the
clients name and then selects a "make quote" button from within the
application. Once they do this .net calls the excel form from the WSS
directory and populates it with the contact information.

Problem is when the form is saved by the user the default directory is
\document library\forms, cause that where the form was pulled from.
Meaning the user has to manual change the directory to \document
library. LOL Like that is going to happen.

If i use a SaveAs statement in an OnOpen macro the document will be
saved in the proper directory but it bypasses Sharepoints MetaData
which is colected by the document libary from the user when the
document is saved. Any type of SaveAs will automaticly bypass this
request to input the MetaData.

Sorry about being long winded, but I hope that makes it clearer.

Thanks
Steve





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programing Help Needed

Sounds like you are saying you want to save the original document, but you
want it have a different name and be saved to a different location.
unfortunately, that is not possible without doing a SaveAs. It sounds like
your solution would have to reside with your interface to the sharepoint
server. Possibly you can define this document as a template and gather data
on workbooks created from that template. I can't say, but it would make
sense that it would support such a construct.

--
Regards,
Tom Ogilvy


"smonczka" wrote in message
oups.com...
The problem with using SaveAs is that I'm pulling the form from a WSS
document library, it's a quote form.

The user opens up a custom contact database application, locates the
clients name and then selects a "make quote" button from within the
application. Once they do this .net calls the excel form from the WSS
directory and populates it with the contact information.

Problem is when the form is saved by the user the default directory is
\document library\forms, cause that where the form was pulled from.
Meaning the user has to manual change the directory to \document
library. LOL Like that is going to happen.

If i use a SaveAs statement in an OnOpen macro the document will be
saved in the proper directory but it bypasses Sharepoints MetaData
which is colected by the document libary from the user when the
document is saved. Any type of SaveAs will automaticly bypass this
request to input the MetaData.

Sorry about being long winded, but I hope that makes it clearer.

Thanks
Steve



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Programing Help Needed

Thanks both for your replys. Tom yes that is what I am trying to do.
I just want to open the file from one directory and have the
application show a different directory when the user saves it.

I'll try the WSS group from here then. Looks like you might be right
and this would have to be handled on the Sharepoint end.

Thanks again,

Steve

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Programing ¿Confused? New Users to Excel 13 March 8th 07 07:23 PM
this is about excel programing ELIYA HAMATI Excel Programming 1 December 13th 04 09:43 PM
VB programing Mestrella31 Excel Programming 3 October 11th 04 03:05 PM
Help with VBA programing CyberStorm Excel Programming 3 July 26th 04 07:57 PM
programing book Matt Excel Programming 1 August 1st 03 08:21 PM


All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"