Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default GetSaveAs Issue in Excel 97

I am trying to export 1 sheet to a new workbook with a specific save as
filename. The filename is created by the excel worksheet in a specific cell.
The issue I have now is getting Excel to save the file as an excel workbook.


The following code works except it does not specify file type:

Dim vSaveWeekly As String
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"))
If vSaveWeekly = "False" Then
Exit Sub
End If
Application.ThisWorkbook.SaveAs vSaveWeekly

When I add in the file filter I get: "Compile Error: Expected List
Separator or )"

I programmed it as this:
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"),"Excel Workbooks *.xlsm)"
,*.xlsm)

Please help, I just need the program to save the file with the specified
name which will always be in the referenced cell, and it needs to be saved as
an Excel 2007 file.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default GetSaveAs Issue in Excel 97

Try something like

Dim FName As Variant
FName = Application.GetSaveAsFilename( _
InitialFileName:="Book1.xlsm", _
Filefilter:="Excel Files (*.xlsm),*.xlsm")

If FName = False Then
' user cancelled
Exit Sub
End If



--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"ZWatts773" wrote in message
...
I am trying to export 1 sheet to a new workbook with a specific save as
filename. The filename is created by the excel worksheet in a specific
cell.
The issue I have now is getting Excel to save the file as an excel
workbook.


The following code works except it does not specify file type:

Dim vSaveWeekly As String
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"))
If vSaveWeekly = "False" Then
Exit Sub
End If
Application.ThisWorkbook.SaveAs vSaveWeekly

When I add in the file filter I get: "Compile Error: Expected List
Separator or )"

I programmed it as this:
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"),"Excel Workbooks *.xlsm)"
,*.xlsm)

Please help, I just need the program to save the file with the specified
name which will always be in the referenced cell, and it needs to be saved
as
an Excel 2007 file.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default GetSaveAs Issue in Excel 97

Hi ZWatts773

Read the info on this page
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
I am trying to export 1 sheet to a new workbook with a specific save as
filename. The filename is created by the excel worksheet in a specific cell.
The issue I have now is getting Excel to save the file as an excel workbook.


The following code works except it does not specify file type:

Dim vSaveWeekly As String
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"))
If vSaveWeekly = "False" Then
Exit Sub
End If
Application.ThisWorkbook.SaveAs vSaveWeekly

When I add in the file filter I get: "Compile Error: Expected List
Separator or )"

I programmed it as this:
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"),"Excel Workbooks *.xlsm)"
,*.xlsm)

Please help, I just need the program to save the file with the specified
name which will always be in the referenced cell, and it needs to be saved as
an Excel 2007 file.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default GetSaveAs Issue in Excel 97

Ron thanks for the info, these macros work great.

The only thing I need to do is have it reference a Cell in the workbook for
the filename. This is a workbook that has fiscal months and a tab for each
week. The weekly needs to be separated out and saved in a specific format ie
ZWatts 3-17 to 3-23. I have a cell programmed with the appropriate filename
format but am unable to get it to reference.

Thoughts? Is this possible?

"Ron de Bruin" wrote:

Hi ZWatts773

Read the info on this page
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
I am trying to export 1 sheet to a new workbook with a specific save as
filename. The filename is created by the excel worksheet in a specific cell.
The issue I have now is getting Excel to save the file as an excel workbook.


The following code works except it does not specify file type:

Dim vSaveWeekly As String
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"))
If vSaveWeekly = "False" Then
Exit Sub
End If
Application.ThisWorkbook.SaveAs vSaveWeekly

When I add in the file filter I get: "Compile Error: Expected List
Separator or )"

I programmed it as this:
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"),"Excel Workbooks *.xlsm)"
,*.xlsm)

Please help, I just need the program to save the file with the specified
name which will always be in the referenced cell, and it needs to be saved as
an Excel 2007 file.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default GetSaveAs Issue in Excel 97

Hi ZWatts773

See this example to save each sheet as a workbook
http://www.rondebruin.nl/copy6.htm


You can change the file name in this part of the code

With Destwb
.SaveAs FolderName _
& "\" & Destwb.Sheets(1).Name & FileExtStr, _
FileFormat:=FileFormatNum
.Close False
End With

What are the names of the week sheets ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
Ron thanks for the info, these macros work great.

The only thing I need to do is have it reference a Cell in the workbook for
the filename. This is a workbook that has fiscal months and a tab for each
week. The weekly needs to be separated out and saved in a specific format ie
ZWatts 3-17 to 3-23. I have a cell programmed with the appropriate filename
format but am unable to get it to reference.

Thoughts? Is this possible?

"Ron de Bruin" wrote:

Hi ZWatts773

Read the info on this page
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
I am trying to export 1 sheet to a new workbook with a specific save as
filename. The filename is created by the excel worksheet in a specific cell.
The issue I have now is getting Excel to save the file as an excel workbook.


The following code works except it does not specify file type:

Dim vSaveWeekly As String
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"))
If vSaveWeekly = "False" Then
Exit Sub
End If
Application.ThisWorkbook.SaveAs vSaveWeekly

When I add in the file filter I get: "Compile Error: Expected List
Separator or )"

I programmed it as this:
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"),"Excel Workbooks *.xlsm)"
,*.xlsm)

Please help, I just need the program to save the file with the specified
name which will always be in the referenced cell, and it needs to be saved as
an Excel 2007 file.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default GetSaveAs Issue in Excel 97

Week 1
Week 2
etc.

I am not sure why I'm having this issue, I have been able to do it on Excel
97, but for some reason it is not working in Excel 2007

"Ron de Bruin" wrote:

Hi ZWatts773

See this example to save each sheet as a workbook
http://www.rondebruin.nl/copy6.htm


You can change the file name in this part of the code

With Destwb
.SaveAs FolderName _
& "\" & Destwb.Sheets(1).Name & FileExtStr, _
FileFormat:=FileFormatNum
.Close False
End With

What are the names of the week sheets ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
Ron thanks for the info, these macros work great.

The only thing I need to do is have it reference a Cell in the workbook for
the filename. This is a workbook that has fiscal months and a tab for each
week. The weekly needs to be separated out and saved in a specific format ie
ZWatts 3-17 to 3-23. I have a cell programmed with the appropriate filename
format but am unable to get it to reference.

Thoughts? Is this possible?

"Ron de Bruin" wrote:

Hi ZWatts773

Read the info on this page
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
I am trying to export 1 sheet to a new workbook with a specific save as
filename. The filename is created by the excel worksheet in a specific cell.
The issue I have now is getting Excel to save the file as an excel workbook.


The following code works except it does not specify file type:

Dim vSaveWeekly As String
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"))
If vSaveWeekly = "False" Then
Exit Sub
End If
Application.ThisWorkbook.SaveAs vSaveWeekly

When I add in the file filter I get: "Compile Error: Expected List
Separator or )"

I programmed it as this:
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"),"Excel Workbooks *.xlsm)"
,*.xlsm)

Please help, I just need the program to save the file with the specified
name which will always be in the referenced cell, and it needs to be saved as
an Excel 2007 file.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default GetSaveAs Issue in Excel 97

Where are the cells with the file names: 3-17
One name on each week tab ?



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
Week 1
Week 2
etc.

I am not sure why I'm having this issue, I have been able to do it on Excel
97, but for some reason it is not working in Excel 2007

"Ron de Bruin" wrote:

Hi ZWatts773

See this example to save each sheet as a workbook
http://www.rondebruin.nl/copy6.htm


You can change the file name in this part of the code

With Destwb
.SaveAs FolderName _
& "\" & Destwb.Sheets(1).Name & FileExtStr, _
FileFormat:=FileFormatNum
.Close False
End With

What are the names of the week sheets ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
Ron thanks for the info, these macros work great.

The only thing I need to do is have it reference a Cell in the workbook for
the filename. This is a workbook that has fiscal months and a tab for each
week. The weekly needs to be separated out and saved in a specific format ie
ZWatts 3-17 to 3-23. I have a cell programmed with the appropriate filename
format but am unable to get it to reference.

Thoughts? Is this possible?

"Ron de Bruin" wrote:

Hi ZWatts773

Read the info on this page
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ZWatts773" wrote in message ...
I am trying to export 1 sheet to a new workbook with a specific save as
filename. The filename is created by the excel worksheet in a specific cell.
The issue I have now is getting Excel to save the file as an excel workbook.


The following code works except it does not specify file type:

Dim vSaveWeekly As String
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"))
If vSaveWeekly = "False" Then
Exit Sub
End If
Application.ThisWorkbook.SaveAs vSaveWeekly

When I add in the file filter I get: "Compile Error: Expected List
Separator or )"

I programmed it as this:
vSaveWeekly = Application.GetSaveAsFilename(Worksheets("Week
1").Range("G1"),"Excel Workbooks *.xlsm)"
,*.xlsm)

Please help, I just need the program to save the file with the specified
name which will always be in the referenced cell, and it needs to be saved as
an Excel 2007 file.



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
New to VBA..need help with automating GETSAVEAS Macro in Excel 2003 xphile Excel Programming 1 January 22nd 06 05:37 AM
timeout on GetSaveAs? msteiert Excel Programming 3 December 13th 05 02:27 AM
No Success with GetSaveAs D.Parker Excel Discussion (Misc queries) 5 April 20th 05 02:16 PM
GetSaveAs Method M. Barnes Excel Programming 5 September 21st 04 10:40 PM
Using GetSaveAs Ron McCormick[_3_] Excel Programming 1 December 17th 03 06:22 PM


All times are GMT +1. The time now is 06:48 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"