L
Larry Stoudemire
In a Sub procedure, I am updating a spreadsheet from queries within Access.
Then I use the 'Call Shell' in Access to open the spreadsheet for viewing.
When opening the spreadhseet, I get a warning message "File???.xls is
already open. Reopening will cause any changes you made to be discarded. Do
you want to reopen File???.xls Yes/No." Is there a way to
prevent this message from showing and requiring a response from the user? In
my older version of Access 2003, this warning message is not displayed in my
Sub procedure which is the same code.
This is an example of my code in the procedure:
strExportPath = "H:\RevenueReporting_SP2\"
rsPath.Close
'*** Will update Excel workbook. The workbook
UnbilledKWHCalculation.xls must exist in output path.
'*** The workbook must include specified worksheets and designated
range names that correspond to
'*** the query names being used in the export. ***
DoCmd.TransferSpreadsheet acExport, 8,
"qselTerritorialSupplyInformation", strExportPath &
"UnbilledKWHCalculation.xls", False, ""
DoCmd.TransferSpreadsheet acExport, 8, "qselCycleInformation",
strExportPath & "UnbilledKWHCalculation.xls", False, ""
DoCmd.TransferSpreadsheet acExport, 8, "qselUnbilledInformation",
strExportPath & "UnbilledKWHCalculation.xls", False, ""
DoCmd.Save acDefault
MsgBox "Unbilled Test workbook created. Will now display for your
review."
Call Shell("C:\Program Files\Microsoft Office\Office11\excel.EXE " &
strExportPath & "UnbilledKWHCalculation.xls", 1)
Exit_UnbilledTest:
Exit Sub................................
Then I use the 'Call Shell' in Access to open the spreadsheet for viewing.
When opening the spreadhseet, I get a warning message "File???.xls is
already open. Reopening will cause any changes you made to be discarded. Do
you want to reopen File???.xls Yes/No." Is there a way to
prevent this message from showing and requiring a response from the user? In
my older version of Access 2003, this warning message is not displayed in my
Sub procedure which is the same code.
This is an example of my code in the procedure:
strExportPath = "H:\RevenueReporting_SP2\"
rsPath.Close
'*** Will update Excel workbook. The workbook
UnbilledKWHCalculation.xls must exist in output path.
'*** The workbook must include specified worksheets and designated
range names that correspond to
'*** the query names being used in the export. ***
DoCmd.TransferSpreadsheet acExport, 8,
"qselTerritorialSupplyInformation", strExportPath &
"UnbilledKWHCalculation.xls", False, ""
DoCmd.TransferSpreadsheet acExport, 8, "qselCycleInformation",
strExportPath & "UnbilledKWHCalculation.xls", False, ""
DoCmd.TransferSpreadsheet acExport, 8, "qselUnbilledInformation",
strExportPath & "UnbilledKWHCalculation.xls", False, ""
DoCmd.Save acDefault
MsgBox "Unbilled Test workbook created. Will now display for your
review."
Call Shell("C:\Program Files\Microsoft Office\Office11\excel.EXE " &
strExportPath & "UnbilledKWHCalculation.xls", 1)
Exit_UnbilledTest:
Exit Sub................................