cancel
Showing results for 
Search instead for 
Did you mean: 

[BEX] VB MACRO Bi AddOn 7.x

0 Kudos

Hi all,

I have a problem with a VB Macro in Bex BI AddOn 7.X,I have to set a Print Area in a Workbook.

I used this VB Macro in a workbook with BEX 3.5

Public Sub SAPBEXonRefresh(queryID As String, resultarea As Range)
    Dim X As Long
    Dim Ultima_colonna As Long
    Dim Ultima_riga As Long
    On Error Resume Next
    
    
' INIZIO FORMATTAZIONE FOGLI
    
    
    If queryID = "SAPBEXq0001" Or queryID = "SAPBEXq0002" Or queryID = "SAPBEXq0004" Or queryID = "SAPBEXq0005" Or queryID = "SAPBEXq0003" Or queryID = "SAPBEXq0006" Then
        Worksheets(resultarea.Worksheet.Name).Select
        Ultima_colonna = resultarea.Cells(resultarea.Cells.Count).Column
        Ultima_riga = resultarea.Cells(resultarea.Cells.Count).Row
       
        ' Area di stampa
        Range(Cells(1, 1), Cells(Ultima_riga, Ultima_colonna)).Select
        ActiveSheet.PageSetup.PrintArea = Selection.Address
        Range("A2").Select
    
    
  
    End If
    
    
' FINE FORMATTAZIONE FOGLI
    

     
End Sub 

I do not understand why this VB Macro dont' work in BEX 7.0

Thx,

ax

Edited by: Alessandro Rizzo on Apr 12, 2010 10:59 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

Are you using the same version of Excel when you check your macro in 3.5//

Regards

Nitin Bhatia

0 Kudos

Yes, I used Office 2007 for both workbook

former_member185181
Active Contributor
0 Kudos

for BI 7, you need to modify the code and put it in defaultworkbook module. Use the table and grid object's property to get the query names.

0 Kudos

Maybe I don't understand.

I put my code in defaultworkbook module (name:BExInterfaceModule) and what I have to do with the table and grid object's??

Thx