303 error with no errorhandler with breakonvbaerror = false

Hi,
I have the following statements in my VB code :

Application.Interactive = False

Set boViewPopup = busobj.Application.CmdBars(2).Controls("&View")
boViewPopup.CmdBar.Controls("&Structure").Execute

These are inside Document_BeforeRefresh

When I schedules the report I got the above error on the BCA.

Is it b’cos of any of the above statements?

This reports runs fine on my machine.

Akshay


akshay :india: (BOB member since 2004-02-05)

This message typically indicates that a VBA run-time error occurred but there was no ON ERROR GOTO statement present to handle it. Put error handling code in place and write the Err object properties to a disk file to diagnose.


dirmiger :us: (BOB member since 2002-08-28)

HI guys,
We are going on production and facing problem in configuring shared drive for BCA.i created a custom macro when i publish through BCA for saving docs in shared drive it is giving

 (303) with no ErrorHandler with BreakOnVBAError=FALSE;

when i include the errorhandler it isnot giving any error but it is nt writing to shared drive but it is saying run successfully.

COuld any body help me in solving this problem

thanks
ksr
:frowning:


bouser_1 (BOB member since 2004-03-20)

Why do you want to execute your code through the menubar. Simply call the function in the Document_Beforerefresh event.

If possible post the code so we can give better explanation


JaiGupta (BOB member since 2002-09-12)

Hi Jai,
Attaching the macro which iam using to copy to shared drive

Option Explicit

Sub FilterAndExport()

  Dim mydoc As Document
  Dim myrpt As Report
  Dim myFilterVar As DocumentVariable

  Dim i, intNumChoices As Integer
  Dim myFilterChoices As Variant
  Dim strNextValue As String
  Dim LOC As String
 
   '   -- Creating new folder
     'Creating a Seperate new folder for every month and Every Day
  
Dim Dated, DateStr, DateStr2, VPath, VPath1, VPath_Regions
Dated = CVar(Date)
DateStr = CStr(Format(Dated, "mm-dd-yy"))
DateStr2 = CStr(Format(Dated, "yyyy-mm"))

VPath = "S:\Reports\" & DateStr2
VPath1 = VPath & "\" & DateStr
If Dir(VPath, vbDirectory) = "" Then
    MkDir (VPath)
    MkDir (VPath1)
End If
'Check if directory exist

If Dir(VPath, vbDirectory) = "" Then
    MkDir (VPath)
End If

' Folder created
 
   LOC = VPath1
  ' Active (open) Document
  Set mydoc = ActiveDocument

  ' Active (with focus) Report
  Set myrpt = ActiveReport
 
  ' Put your variable (or query object) here
  Set myFilterVar = mydoc.DocumentVariables("Resort")

  ' find out how many resort values there are
  intNumChoices = UBound(myFilterVar.Values(boUniqueValues))

  ' collect the number of choices in a variant variable
  myFilterChoices = myFilterVar.Values(boUniqueValues)

  For i = 1 To intNumChoices
   
    ' Get the variable value
    strNextValue = myFilterChoices(i)
    
    ' build filter
    myrpt.AddComplexFilter myFilterVar, "=<Resort> = " &amp; """" &amp; strNextValue &amp; """"
    
    ' recompute the report
    myrpt.ForceCompute
    
    ' now export to desired format, using the filter value as part of the name
    myrpt.ExportAsExcel (LOC &amp; "\" &amp; strNextValue &amp; ".xls")
    
  Next i

  ' now, unless I can find a RemoveComplexFilter function, this line is used
  ' to invoke a filter that is always true.
  
  myrpt.AddComplexFilter myFilterVar, "=(1=1)"
  myrpt.ForceCompute

End Sub

Advance thanks for your reply.

thanks
bouser_1


bouser_1 (BOB member since 2004-03-20)

Hmmm, that looks familiar. :slight_smile:

First suggestion… remove the call to the “S:” drive and replace it with UNC instead. In other words, if the “S” drive is mapped from a server called “Shared” then use \Shared\Path to address the output path instead. When code is run via BCA there are no mapped drives.


Dave Rathbun :us: (BOB member since 2002-06-06)