Quantcast
Channel: SCN : Discussion List - SAP Business Explorer (SAP BEx)
Viewing all articles
Browse latest Browse all 4032

Self closing BEx workbook with VBA

$
0
0

Hello,

 

I need to close the current BEx instance and workbook without saving it.  I am using VBA code that is widely suggested to achieve this .  It works perfectly on a pure Excel instance but with a BEx instance, it will prompt to save the current workbook before exiting.

 

Here is the stripped-down code I am using:

 

Sub ExitWithoutSaving

 

    cells(1,1) = cells(1,1) + 1   ' Modify content of current workbook to simulate activity on the workbook

 

    ActiveWorkbook.Saved = true   ' Force Excel to believe that the workbook has already been saved

    Application.Quit

 

 

End Sub

 

 

I am using BEx (BI Add-On 7.X ( based on 7.30)) on Excel 2010 on Windows 7.  

 

The code can be added as is to a New blank Excel file (Excel with no BEx) or to a new blank BEx workbook with no queries inside, no need to even login.   A simple insert Module is all you need to verify the code.

 

Would someone try it on a similar environment to help me know if something is wrong with my set-up or if it is the code that is the problem ?  When we know I am not the problem, may-be someone will be able to help...

 

I tried also with the EnableEvents on or off...

I also tried saving the file first with Application.SaveAs just before Application.Quit: no different results


Viewing all articles
Browse latest Browse all 4032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>