Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default HDI set cell content as the default file name for a new Excel wb

I am developing an Excel form for a very large group of inexperienced Excel
users at my workplace. The process needs to be as easy as possible! The
objective is for users to only have to input their unique data into the
master form and then click on a macro button. The macro generates a new
separate file with all their data processed in the manner necessary. That
all is working fine. However, each of these new files created through the
master form needs to have its own unique file name using a specific naming
convention. I would strongly prefer that the users not have to name their
new file themselves -- I want the macro to do it for them.

I can easily use formula to put the proper file name text into a cell of the
new workbook, but cannot figure out how to get it that text into the Save-as
file-name box when the file is first saved. This all would be very simple if
Excel worked like Word, where the default file name comes from the beginning
of the document. If I could just make it read A1 as the default that would
be great, but Excel defaults to "Book1" instead. Any suggestions would be
greatly appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default HDI set cell content as the default file name for a new Excel wb

Application.Dialogs(xlDialogSaveAs).Show

If this post helps click Yes
---------------
Jacob Skaria


"Allouette" wrote:

I am developing an Excel form for a very large group of inexperienced Excel
users at my workplace. The process needs to be as easy as possible! The
objective is for users to only have to input their unique data into the
master form and then click on a macro button. The macro generates a new
separate file with all their data processed in the manner necessary. That
all is working fine. However, each of these new files created through the
master form needs to have its own unique file name using a specific naming
convention. I would strongly prefer that the users not have to name their
new file themselves -- I want the macro to do it for them.

I can easily use formula to put the proper file name text into a cell of the
new workbook, but cannot figure out how to get it that text into the Save-as
file-name box when the file is first saved. This all would be very simple if
Excel worked like Word, where the default file name comes from the beginning
of the document. If I could just make it read A1 as the default that would
be great, but Excel defaults to "Book1" instead. Any suggestions would be
greatly appreciated!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default HDI set cell content as the default file name for a new Excel wb

You can avoid using the SaveAs and get the user name using the below

'--------GetUserName
Environ("Username")

OR

'-----Get User Name
Set objNet = CreateObject("WScript.NetWork")
strUserName = Trim(objNet.UserName)


OR even get the domain name

'-----Retrieve Domain Name
' Reference Active DS Type Library Tools|Reference
Dim strAD As New ADSystemInfo
strDomainname = strAD.DomainShortName

If this post helps click Yes
---------------
Jacob Skaria


"Allouette" wrote:

I am developing an Excel form for a very large group of inexperienced Excel
users at my workplace. The process needs to be as easy as possible! The
objective is for users to only have to input their unique data into the
master form and then click on a macro button. The macro generates a new
separate file with all their data processed in the manner necessary. That
all is working fine. However, each of these new files created through the
master form needs to have its own unique file name using a specific naming
convention. I would strongly prefer that the users not have to name their
new file themselves -- I want the macro to do it for them.

I can easily use formula to put the proper file name text into a cell of the
new workbook, but cannot figure out how to get it that text into the Save-as
file-name box when the file is first saved. This all would be very simple if
Excel worked like Word, where the default file name comes from the beginning
of the document. If I could just make it read A1 as the default that would
be great, but Excel defaults to "Book1" instead. Any suggestions would be
greatly appreciated!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default HDI set cell content as the default file name for a new Excel

Thank you for responding, but I'm afraid both your replies are above my head!
The process I am trying to manage is for recording incoming payments across
a large municipality. I don't need to know the user name for the file name.
The file name should be a concatenation of three pieces of information:
payment location, date of deposit, and dollar amount. I have formula so that
one of the cells of the newly created workbook has the text exactly as the
file should be named. The problem is actually getting the new file named
that way (with a macro or some method other than my end-users). Thanks again!

"Jacob Skaria" wrote:

You can avoid using the SaveAs and get the user name using the below

'--------GetUserName
Environ("Username")

OR

'-----Get User Name
Set objNet = CreateObject("WScript.NetWork")
strUserName = Trim(objNet.UserName)


OR even get the domain name

'-----Retrieve Domain Name
' Reference Active DS Type Library Tools|Reference
Dim strAD As New ADSystemInfo
strDomainname = strAD.DomainShortName

If this post helps click Yes
---------------
Jacob Skaria


"Allouette" wrote:

I am developing an Excel form for a very large group of inexperienced Excel
users at my workplace. The process needs to be as easy as possible! The
objective is for users to only have to input their unique data into the
master form and then click on a macro button. The macro generates a new
separate file with all their data processed in the manner necessary. That
all is working fine. However, each of these new files created through the
master form needs to have its own unique file name using a specific naming
convention. I would strongly prefer that the users not have to name their
new file themselves -- I want the macro to do it for them.

I can easily use formula to put the proper file name text into a cell of the
new workbook, but cannot figure out how to get it that text into the Save-as
file-name box when the file is first saved. This all would be very simple if
Excel worked like Word, where the default file name comes from the beginning
of the document. If I could just make it read A1 as the default that would
be great, but Excel defaults to "Book1" instead. Any suggestions would be
greatly appreciated!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default HDI set cell content as the default file name for a new Excel

If you are looking to get the save event wrote the code in the
Workbook_BeforeSave event

strFileName = Get file name here
'Save the new workbook.
ActiveWorkbook.SaveAs (strPath & strFileName)

If this post helps click Yes
---------------
Jacob Skaria


"Allouette" wrote:

Thank you for responding, but I'm afraid both your replies are above my head!
The process I am trying to manage is for recording incoming payments across
a large municipality. I don't need to know the user name for the file name.
The file name should be a concatenation of three pieces of information:
payment location, date of deposit, and dollar amount. I have formula so that
one of the cells of the newly created workbook has the text exactly as the
file should be named. The problem is actually getting the new file named
that way (with a macro or some method other than my end-users). Thanks again!

"Jacob Skaria" wrote:

You can avoid using the SaveAs and get the user name using the below

'--------GetUserName
Environ("Username")

OR

'-----Get User Name
Set objNet = CreateObject("WScript.NetWork")
strUserName = Trim(objNet.UserName)


OR even get the domain name

'-----Retrieve Domain Name
' Reference Active DS Type Library Tools|Reference
Dim strAD As New ADSystemInfo
strDomainname = strAD.DomainShortName

If this post helps click Yes
---------------
Jacob Skaria


"Allouette" wrote:

I am developing an Excel form for a very large group of inexperienced Excel
users at my workplace. The process needs to be as easy as possible! The
objective is for users to only have to input their unique data into the
master form and then click on a macro button. The macro generates a new
separate file with all their data processed in the manner necessary. That
all is working fine. However, each of these new files created through the
master form needs to have its own unique file name using a specific naming
convention. I would strongly prefer that the users not have to name their
new file themselves -- I want the macro to do it for them.

I can easily use formula to put the proper file name text into a cell of the
new workbook, but cannot figure out how to get it that text into the Save-as
file-name box when the file is first saved. This all would be very simple if
Excel worked like Word, where the default file name comes from the beginning
of the document. If I could just make it read A1 as the default that would
be great, but Excel defaults to "Book1" instead. Any suggestions would be
greatly appreciated!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default HDI set cell content as the default file name for a new Excel

strFileName = Range("A1")
OR
strFileName = Cells(1,1)
ActiveWorkbook.SaveAs (strPath & strFileName)

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

If you are looking to get the save event wrote the code in the
Workbook_BeforeSave event

strFileName = Get file name here
'Save the new workbook.
ActiveWorkbook.SaveAs (strPath & strFileName)

If this post helps click Yes
---------------
Jacob Skaria


"Allouette" wrote:

Thank you for responding, but I'm afraid both your replies are above my head!
The process I am trying to manage is for recording incoming payments across
a large municipality. I don't need to know the user name for the file name.
The file name should be a concatenation of three pieces of information:
payment location, date of deposit, and dollar amount. I have formula so that
one of the cells of the newly created workbook has the text exactly as the
file should be named. The problem is actually getting the new file named
that way (with a macro or some method other than my end-users). Thanks again!

"Jacob Skaria" wrote:

You can avoid using the SaveAs and get the user name using the below

'--------GetUserName
Environ("Username")

OR

'-----Get User Name
Set objNet = CreateObject("WScript.NetWork")
strUserName = Trim(objNet.UserName)


OR even get the domain name

'-----Retrieve Domain Name
' Reference Active DS Type Library Tools|Reference
Dim strAD As New ADSystemInfo
strDomainname = strAD.DomainShortName

If this post helps click Yes
---------------
Jacob Skaria


"Allouette" wrote:

I am developing an Excel form for a very large group of inexperienced Excel
users at my workplace. The process needs to be as easy as possible! The
objective is for users to only have to input their unique data into the
master form and then click on a macro button. The macro generates a new
separate file with all their data processed in the manner necessary. That
all is working fine. However, each of these new files created through the
master form needs to have its own unique file name using a specific naming
convention. I would strongly prefer that the users not have to name their
new file themselves -- I want the macro to do it for them.

I can easily use formula to put the proper file name text into a cell of the
new workbook, but cannot figure out how to get it that text into the Save-as
file-name box when the file is first saved. This all would be very simple if
Excel worked like Word, where the default file name comes from the beginning
of the document. If I could just make it read A1 as the default that would
be great, but Excel defaults to "Book1" instead. Any suggestions would be
greatly appreciated!

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
content of cell change when print file Hafsa Excel Discussion (Misc queries) 1 July 3rd 06 01:27 PM
How do I preserve cell content when saving an excel file in csv beachwurm Excel Discussion (Misc queries) 1 June 29th 06 08:18 PM
How do I backup all of Excel and file content to DVD? inkbran Excel Discussion (Misc queries) 1 May 27th 06 05:14 PM
link cell content to another file blackstar Excel Discussion (Misc queries) 2 April 4th 06 03:20 AM
How do you use EXCEL formula in properties of file (cell content) chiefcook Excel Discussion (Misc queries) 1 November 10th 05 04:53 PM


All times are GMT +1. The time now is 10:06 AM.

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"