Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Save Dialog pops up now - Excel 2007

I have a macro that creates my file and then saves it. I've just
recently upgraded to Office 2007, and now Excel prompts me to save the
file when it didn't before.

I'm doing a SaveAs, and specifying the path\filename. Can I turn off
the "Do you want to save" message and just do it? Code follows:


Public Sub SaveExcelReport(strFullName As String)
Dim objFS As Object
Dim strFolder As String
On Error GoTo SaveExcelReport_Error:
''Create reports directory if it doesn't exist
Set objFS = CreateObject("Scripting.FileSystemObject")
strFolder = Left$(strFullName, InStrRev(strFullName, "\", -1,
vbTextCompare))
If Not objFS.folderexists(strFolder) Then
objFS.createfolder (strFolder)
End If
''Overwrite without warning
xlaReport.DisplayAlerts = False
xlaReport.ActiveWorkbook.SaveAs strFullName, xlExcel12, "", "",
False, False, xlNoChange, xlLocalSessionChanges
''Old (Access 2003) version
'xlaReport.ActiveWorkbook.SaveAs strFullName, xlNormal, "", "",
False, False
xlaReport.DisplayAlerts = True
Exit Sub
SaveExcelReport_Error:
Debug.Print Err.Description
Resume Next
End Sub

Thanks for taking the time to look,
Chris M.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Save Dialog pops up now - Excel 2007

On Jan 7, 2:22*pm, mcescher wrote:
I have a macro that creates my file and then saves it. *I've just
recently upgraded to Office 2007, and now Excel prompts me to save the
file when it didn't before.

I'm doing a SaveAs, and specifying the path\filename. *Can I turn off
the "Do you want to save" message and just do it? *Code follows:

Public Sub SaveExcelReport(strFullName As String)
* Dim objFS As Object
* Dim strFolder As String
* On Error GoTo SaveExcelReport_Error:
''Create reports directory if it doesn't exist
* Set objFS = CreateObject("Scripting.FileSystemObject")
* strFolder = Left$(strFullName, InStrRev(strFullName, "\", -1,
vbTextCompare))
* If Not objFS.folderexists(strFolder) Then
* * objFS.createfolder (strFolder)
* End If
''Overwrite without warning
* xlaReport.DisplayAlerts = False
* xlaReport.ActiveWorkbook.SaveAs strFullName, xlExcel12, "", "",
False, False, xlNoChange, xlLocalSessionChanges
''Old (Access 2003) version
* 'xlaReport.ActiveWorkbook.SaveAs strFullName, xlNormal, "", "",
False, False
* xlaReport.DisplayAlerts = True
* Exit Sub
SaveExcelReport_Error:
* Debug.Print Err.Description
* Resume Next
End Sub

Thanks for taking the time to look,
Chris M.


I did try changing the file type to xlWorkbookNormal, and then it
saves fine, but when I double click on the resulting file, I get an
error message "Excel cannot open the file XXXXXX.xlsx because the file
format or file extension is not valid. Verify that the file has not
been corrupted and that the file extension matches the format of the
file"

sigh....

Thanks!
Chris M.
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
How to capture Excel Save As dialog box? Aruna Akella Excel Programming 7 May 15th 07 11:24 PM
Choose a digital certificate pops up when trying to save excel file from browser [email protected] Excel Discussion (Misc queries) 0 April 24th 07 03:16 PM
Save Excel Worksheet As CSV - No Save As Dialog SQLServant Excel Programming 1 September 29th 06 12:36 PM
How do I display a dialog box that pops up when you first open exc Erin Excel Discussion (Misc queries) 4 June 22nd 05 07:27 PM
Excel Save pops up when unloading Addin file KimberlyC Excel Programming 0 June 9th 04 08:47 PM


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