BEx VBA functions for Excel

I have a requirement to create a WorkBook from a query that uses a hierarchy. It needs to have a couple of columns that use Excel formulas because there are user input cells that affect the formula. However when I expand or collapse the hierarchy the Excel formulas lose their reference (#REF!). Is there some existing VBA code to reset the worksheet formula references when the hierarchy is expanded or collapsed? Yes I'm using BEx Analyzer 3.5.
Thank you!
Al

I used VBA in the WB as a solution.

Similar Messages

  • Smartview VBA function for launch calc-scripts as strings. like EsbCalc ???

    We have used an Excel VBA which launch an calculation script from a STRING using the VBA Add-In function "EsbCalc".
    We would like to migrate to Smartview VBA functions.....
    The calc-script string has "parameters" which are modified at run-time...
    I have found the function HypExecuteCalcScript - but seems that use as parameters ONLY the calc-script name...
    Is it any VBA function in SmartView which launch a calc-script string (not a calc-script name) ?
    We are using EPM 11.2
    Thanks...

    A tip I just learned at Kaleidoscope 2010* is that one can create a calc script consisting entirely of a substitution variable. In other words, a calc script can look like this:
    &Calc
    Smart View VBA does have a function for changing or creating substitution variables (HypSetSubstitutionVariable). You could create a calc script and subvar in your database as above. Then, at run time, set that subvar to your calc string with HypSetSubstitutionVariable and execute the calc script with HypExecuteCalcScript.
    Quick test (11.1.1.3) shows that this really works.
    I can't remember privileges required to create or set subvars vs execute calc strings off the top of my head - might be an issue (I ran as an admin). Also this approach doesn't support concurrent users, unless they each have a calc script and subvar to themselves. Still, depending on your exact situation, this might be a feasible workaround.
    *I won't credit the presenter solely because the tip came from a presentation which he specifically declined to make public domain.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • VBA Code for Excel Add-in Menu Items

    Howdy.
    Every month my team needs to execute the same process on a couple hundred documents. It's time consuming and inefficient to say the least, so I'm looking for a means by which to call a couple of the menu items on the Excel BPC Add-Ins menu via VBA. Specifically, Park'n'Go; Expand All; and Send and Refresh Schedules.
    Basically what happens is this:
    Open File
    Set Park'n'Go to Live
    Expand All
    Refresh and Send Schedules
    Set Park'n'Go to Offline
    Save
    Exit
    Loop
    I know how to loop through the files and directories, I just don't know the commands for the functions from the menu via code. The macro recorder can't help me, and I've even tried to mimic a user's actions by using mouse coordinates and clicks, but that doesn't work b/c it doesn't allow for the necessary load time from BPC.
    Any help would be extremely appreciated.

    Hey Jeff,
    here are some vba commands that may help you.
    Open a certain file: (you can assign "Path" to a button or range)
    Dim Path As String
    Path = Application.GetOpenFilename("All Files (.),.")
    Opening the Park 'n Go dialog box:
    Application.Run ("MNU_ETOOLS_PARKNGO")
    Expand All:
    Application.Run ("MNU_ETOOLS_EXPAND")
    Sending data and refreshing the workbook:
    Application.Run ("MNU_eSUBMIT_REFSCHEDULE_BOOK_REFRESH")
    Saving a file OFFLINE:
    Dim FName As String
    FName = InputBox(prompt:="Please enter filename")
    If FName = "" Then
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Else
    ActiveWorkbook.SaveAs Filename:="c:\" & FName
    ActiveWorkbook.Close
    End If
    Application.DisplayAlerts = True
    Hope, that will help you
    Karsten

  • Lost functions for excel

    I receive files from my boss and I need to edit them using my computer. The problem is that I use Numbers, and he uses Excel. Formulas and functions get lost and get miscontrued during the process, so it inevitably leaves me sending back the file with missing or incorrect formulas. Are there any drivers or extensions I can download to help me out with the converting from excel to numbers? I hate sending back unfinished work.

    Jerry,
    Perhaps I misread the OPs text.  I focused on the line:
    he problem is that I use Numbers, and he uses Excel.
    Which leads me to believe the problem is in importing and export between Excel <--> Numbers NOT between version of Numbers.
    Wayne

  • Smartview VBA functions

    Hi All,
    Is there any link or documentation listing the VBA functions for Smartview equivalent to the functions in excel addin.
    Thanks,
    Raja

    You too have noticed that there are quite a few functions missing. :)
    Some of these items are because the functions aren't in SV at all, others because they are not exposed to the API.
    You may be in luck with aliases as HypSetAliasTable will allow you to set the table, but not to turn aliases on and off.
    If you are in 11.x, you might also want to take a look at HypSetConnAliasTable. I think that will actually change the alias table for the currently defined connection.
    As for LROs, secondary buttons, and DTS, I think you are out of luck -- those items are not in SV so there are no corresponding functions.
    I had a mildly painful experience with SV VBA early last year -- there were quite a few bugs. I think at one point I had identified eight defects (this was the old esupport web site). If you are on 9.3.x, make sure you are as up to date as possible.
    Regards,
    Cameron Lackpour

  • Error in running a function to convert coordinates in degrees to decimal for EXCEL VBA

    For your information, I have 3 cross-posts regarding this question - and all I can said there is still no firm solution regarding this error.
    1) http://stackoverflow.com/questions/27634586/error-in-running-a-function-to-convert-coordinates-in-degrees-to-decimal-for-exc/27637367#27637367
    2) http://www.mrexcel.com/forum/excel-questions/826099-error-running-function-convert-coordinates-degrees-decimal-excel-visual-basic-applications.html#post4030377 
    3) http://www.excelguru.ca/forums/showthread.php?3909-Error-in-running-a-function-to-convert-coordinates-in-degrees-to-decimal-for-EXCEL-VB&p=16507#post16507
    and the story of the error is as below:
    Currently I am working on VBA excel to create a widget to verify coordinates whether it lies under the radius of ANOTHER predefined and pre-specified sets of coordinates.
    In the module, I want to convert the coordinates from degrees to decimal before doing the calculation - as the formula of the calculation only allow the decimal form of coordinates.
    However, each and every time I want to run the macros this error (Run-time error '5', invalid procedure call or argument) will appear. Then, the debug button will bring me to below line of coding:
    degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
    For your information, the full function is as below:
    Function Convert_Decimal(Degree_Deg As String) As Double
    'source: http://support.microsoft.com/kb/213449
    Dim degrees As Double
    Dim minutes As Double
    Dim seconds As Double
    Degree_Deg = Replace(Degree_Deg, "~", "°")
    degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
    minutes = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 2, _
    InStr(1, Degree_Deg, "'") - InStr(1, Degree_Deg, "°") - 2)) / 60
    seconds = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "'") + _
    2, Len(Degree_Deg) - InStr(1, Degree_Deg, "'") - 2)) / 3600
    Convert_Decimal = degrees + minutes + seconds
    End Function
    Thank you.
    Your kind assistance and attention in this matter are highly appreciated.
    Regards,
    Nina.

    You didn't give an example of your input string but try the following
    Sub test()
    Dim s As String
    s = "180° 30' 30.5""""" ' double quote for seconds
    Debug.Print Deg2Dec(s) ' 180.508472222222
    End Sub
    Function Deg2Dec(sAngle As String) As Double
    Dim mid1 As Long
    Dim mid2 As Long
    Dim degrees As Long
    Dim minutes As Long
    Dim seconds As Double ' or Long if only integer seconds
    sAngle = Replace(sAngle, " ", "")
    mid1 = InStr(sAngle, "°")
    mid2 = InStr(sAngle, "'")
    degrees = CLng(Left$(sAngle, mid1 - 1))
    minutes = CLng(Mid$(sAngle, mid1 + 1, mid2 - mid1 - 1))
    seconds = Val(Mid$(sAngle, mid2 + 1, 10)) ' change 10 to 2 if only integer seconds
    Deg2Dec = degrees + minutes / 60 + seconds / 3600
    End Function
    As written the function assumes values for each of deg/min/sec are included with unit indicators as given. Adapt for your needs.
    In passing, for any work with trig functions you will probably need to convert the degrees to radians.

  • Need Assistance for VBA function in oracle how to implement

    My very respected and Senior, regards,
    Sir, hope you will in best of health and wealth by the grace of God,
    Sir, i have a request problem as i m very junior against you and you have passed this time before many years ago as i m standing where. Sir i m a very junior developer of oracle and have a problem putting on your desk with the hope that you can help my as a boss.
    Sir me have to calculate yield of Bond using oracle form
    i have tried my best and tired
    there is a formulae in excel which give the Yield() when we provide the parameters
    and i need the excel formulae or the oracle calculation code of PLSQL for this.
    How can i get yield when i have price, coupon rate, frequency, issue and maturity of the coupon , coupon period , next coming coupon , and others detail.
    or tell me how to use EXCEL VBA for this problem ,
    thnx n regards,
    yours student, junior developer youngest brother
    Faraz
    How can I get the solution using Excel VBA function with oracle
    so that move values to excel calculate them and copy the result from excel to oracle forms

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Sending and receivind ADC coefficients from/to soundcard in VBA for Excel 2010

    How to send  and receive ADC coefficients from/to soundcard(mixer,microphone)     in VBA for Excel 2010   (noncom. edition, x64)   to Excel macros for DFT (from IDFT), IIR , user defined samples parser   (special
    noise generator, graphic s(t),S(jw), arg s(jw)    soundcard AFR test ) ?
    What .dll is need for this (without bass.dll)?

    Example from internet :
    'This project needs a module and a form
    'The form must contain two labels, two progressbars, a timer and a checkbox
    'Paste this code into the form
    Dim hmixer As Long ' mixer handle
    Dim inputVolCtrl As MIXERCONTROL ' waveout volume control
    Dim outputVolCtrl As MIXERCONTROL ' microphone volume control
    Dim rc As Long ' return code
    Dim ok As Boolean ' boolean return code
    Dim mxcd As MIXERCONTROLDETAILS ' control info
    Dim vol As MIXERCONTROLDETAILS_SIGNED ' control's signed value
    Dim volume As Long ' volume value
    Dim volHmem As Long ' handle to volume memory
    Private Sub Form_Load()
    Me.ScaleMode = vbTwips
    Me.Caption = "Volume meter"
    Label1.Move 0, 0
    Label1.AutoSize = True
    Label1.Caption = "Input level"
    Label2.Move 0, 4 * Label1.Height
    Label2.AutoSize = True
    Label2.Caption = "Output level"
    ProgressBar1.Move Label1.Width * 2, 0, 3375
    ProgressBar2.Move Label1.Width * 2, Label2.Top, 3375
    Check1.Move ProgressBar1.Left, ProgressBar1.Height
    Check1.Caption = "Get Input"
    Me.Move Me.Left, Me.Top, ProgressBar1.Width + ProgressBar1.Left + 10 * Screen.TwipsPerPixelX, ProgressBar2.Top + ProgressBar2.Height + 30 * Screen.TwipsPerPixelY
    Timer1.Interval = 50
    Timer1.Enabled = True
    ' Open the mixer specified by DEVICEID
    rc = mixerOpen(hmixer, DEVICEID, 0, 0, 0)
    If ((MMSYSERR_NOERROR &lt;&gt; rc)) Then
    MsgBox "Couldn't open the mixer."
    Exit Sub
    End If
    ' Get the input volume meter
    ok = GetControl(hmixer, MIXERLINE_COMPONENTTYPE_DST_WAVEIN, MIXERCONTROL_CONTROLTYPE_PEAKMETER, inputVolCtrl)
    If (ok &lt;&gt; True) Then
    ok = GetControl(hmixer, MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, MIXERCONTROL_CONTROLTYPE_PEAKMETER, inputVolCtrl)
    End If
    If (ok = True) Then
    ProgressBar1.Min = 0
    ProgressBar1.Max = inputVolCtrl.lMaximum
    Else
    ProgressBar1.Enabled = False
    MsgBox "Couldn't get wavein meter"
    End If
    ' Get the output volume meter
    ok = GetControl(hmixer, MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT, MIXERCONTROL_CONTROLTYPE_PEAKMETER, outputVolCtrl)
    If (ok = True) Then
    ProgressBar2.Min = 0
    ProgressBar2.Max = outputVolCtrl.lMaximum
    Else
    ProgressBar2.Enabled = False
    MsgBox "Couldn't get waveout meter"
    End If
    ' Initialize mixercontrol structure
    mxcd.cbStruct = Len(mxcd)
    volHmem = GlobalAlloc(&amp;H0, Len(volume)) ' Allocate a buffer for the volume value
    mxcd.paDetails = GlobalLock(volHmem)
    mxcd.cbDetails = Len(volume)
    mxcd.cChannels = 1
    End Sub
    Private Sub Check1_Click()
    If (Check1.Value = 1) Then
    StartInput ' Start receiving audio input
    Else
    StopInput ' Stop receiving audio input
    End If
    End Sub
    Private Sub Timer1_Timer()
    On Error Resume Next
    ' Process sound buffer if recording
    If (fRecording) Then
    For i = 0 To (NUM_BUFFERS - 1)
    If inHdr(i).dwFlags And WHDR_DONE Then
    rc = waveInAddBuffer(hWaveIn, inHdr(i), Len(inHdr(i)))
    End If
    Next
    End If
    ' Get the current input level
    If (ProgressBar1.Enabled = True) Then
    mxcd.dwControlID = inputVolCtrl.dwControlID
    mxcd.item = inputVolCtrl.cMultipleItems
    rc = mixerGetControlDetails(hmixer, mxcd, MIXER_GETCONTROLDETAILSF_VALUE)
    CopyStructFromPtr volume, mxcd.paDetails, Len(volume)
    If (volume &lt; 0) Then
    volume = -volume
    End If
    ProgressBar1.Value = volume
    End If
    ' Get the current output level
    If (ProgressBar2.Enabled = True) Then
    mxcd.dwControlID = outputVolCtrl.dwControlID
    mxcd.item = outputVolCtrl.cMultipleItems
    rc = mixerGetControlDetails(hmixer, mxcd, MIXER_GETCONTROLDETAILSF_VALUE)
    CopyStructFromPtr volume, mxcd.paDetails, Len(volume)
    If (volume &lt; 0) Then volume = -volume
    ProgressBar2.Value = volume
    End If
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
    If (fRecording = True) Then
    StopInput
    End If
    GlobalFree volHmem
    End Sub
    'Paste this code into the module
    Public Const CALLBACK_FUNCTION = &amp;H30000
    Public Const MM_WIM_DATA = &amp;H3C0
    Public Const WHDR_DONE = &amp;H1 ' done bit
    Public Const GMEM_FIXED = &amp;H0 ' Global Memory Flag used by GlobalAlloc functin
    Type WAVEHDR
    lpData As Long
    dwBufferLength As Long
    dwBytesRecorded As Long
    dwUser As Long
    dwFlags As Long
    dwLoops As Long
    lpNext As Long
    Reserved As Long
    End Type
    Type WAVEINCAPS
    wMid As Integer
    wPid As Integer
    vDriverVersion As Long
    szPname As String * 32
    dwFormats As Long
    wChannels As Integer
    End Type
    Type WAVEFORMAT
    wFormatTag As Integer
    nChannels As Integer
    nSamplesPerSec As Long
    nAvgBytesPerSec As Long
    nBlockAlign As Integer
    wBitsPerSample As Integer
    cbSize As Integer
    End Type
    Declare Function waveInOpen Lib "winmm.dll" (lphWaveIn As Long, ByVal uDeviceID As Long, lpFormat As WAVEFORMAT, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long
    Declare Function waveInPrepareHeader Lib "winmm.dll" (ByVal hWaveIn As Long, lpWaveInHdr As WAVEHDR, ByVal uSize As Long) As Long
    Declare Function waveInReset Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
    Declare Function waveInStart Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
    Declare Function waveInStop Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
    Declare Function waveInUnprepareHeader Lib "winmm.dll" (ByVal hWaveIn As Long, lpWaveInHdr As WAVEHDR, ByVal uSize As Long) As Long
    Declare Function waveInClose Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
    Declare Function waveInGetDevCaps Lib "winmm.dll" Alias "waveInGetDevCapsA" (ByVal uDeviceID As Long, lpCaps As WAVEINCAPS, ByVal uSize As Long) As Long
    Declare Function waveInGetNumDevs Lib "winmm.dll" () As Long
    Declare Function waveInGetErrorText Lib "winmm.dll" Alias "waveInGetErrorTextA" (ByVal err As Long, ByVal lpText As String, ByVal uSize As Long) As Long
    Declare Function waveInAddBuffer Lib "winmm.dll" (ByVal hWaveIn As Long, lpWaveInHdr As WAVEHDR, ByVal uSize As Long) As Long
    Public Const MMSYSERR_NOERROR = 0
    Public Const MAXPNAMELEN = 32
    Public Const MIXER_LONG_NAME_CHARS = 64
    Public Const MIXER_SHORT_NAME_CHARS = 16
    Public Const MIXER_GETLINEINFOF_COMPONENTTYPE = &amp;H3&amp;
    Public Const MIXER_GETCONTROLDETAILSF_VALUE = &amp;H0&amp;
    Public Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &amp;H2&amp;
    Public Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &amp;H0&amp;
    Public Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &amp;H1000&amp;
    Public Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
    Public Const MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
    Public Const MIXERLINE_COMPONENTTYPE_SRC_LINE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
    Public Const MIXERCONTROL_CT_CLASS_FADER = &amp;H50000000
    Public Const MIXERCONTROL_CT_UNITS_UNSIGNED = &amp;H30000
    Public Const MIXERCONTROL_CT_UNITS_SIGNED = &amp;H20000
    Public Const MIXERCONTROL_CT_CLASS_METER = &amp;H10000000
    Public Const MIXERCONTROL_CT_SC_METER_POLLED = &amp;H0&amp;
    Public Const MIXERCONTROL_CONTROLTYPE_FADER = (MIXERCONTROL_CT_CLASS_FADER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
    Public Const MIXERCONTROL_CONTROLTYPE_VOLUME = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
    Public Const MIXERLINE_COMPONENTTYPE_DST_WAVEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
    Public Const MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
    Public Const MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER Or MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_SIGNED)
    Public Const MIXERCONTROL_CONTROLTYPE_PEAKMETER = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
    Declare Function mixerClose Lib "winmm.dll" (ByVal hmx As Long) As Long
    Declare Function mixerGetControlDetails Lib "winmm.dll" Alias "mixerGetControlDetailsA" (ByVal hmxobj As Long, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails As Long) As Long
    Declare Function mixerGetDevCaps Lib "winmm.dll" Alias "mixerGetDevCapsA" (ByVal uMxId As Long, ByVal pmxcaps As MIXERCAPS, ByVal cbmxcaps As Long) As Long
    Declare Function mixerGetID Lib "winmm.dll" (ByVal hmxobj As Long, pumxID As Long, ByVal fdwId As Long) As Long
    Declare Function mixerGetLineInfo Lib "winmm.dll" Alias "mixerGetLineInfoA" (ByVal hmxobj As Long, pmxl As MIXERLINE, ByVal fdwInfo As Long) As Long
    Declare Function mixerGetLineControls Lib "winmm.dll" Alias "mixerGetLineControlsA" (ByVal hmxobj As Long, pmxlc As MIXERLINECONTROLS, ByVal fdwControls As Long) As Long
    Declare Function mixerGetNumDevs Lib "winmm.dll" () As Long
    Declare Function mixerMessage Lib "winmm.dll" (ByVal hmx As Long, ByVal uMsg As Long, ByVal dwParam1 As Long, ByVal dwParam2 As Long) As Long
    Declare Function mixerOpen Lib "winmm.dll" (phmx As Long, ByVal uMxId As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal fdwOpen As Long) As Long
    Declare Function mixerSetControlDetails Lib "winmm.dll" (ByVal hmxobj As Long, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails As Long) As Long
    Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory" (struct As Any, ByVal ptr As Long, ByVal cb As Long)
    Declare Sub CopyPtrFromStruct Lib "kernel32" Alias "RtlMoveMemory" (ByVal ptr As Long, struct As Any, ByVal cb As Long)
    Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
    Declare Function GlobalLock Lib "kernel32" (ByVal hmem As Long) As Long
    Declare Function GlobalFree Lib "kernel32" (ByVal hmem As Long) As Long
    Type MIXERCAPS
    wMid As Integer
    wPid As Integer
    vDriverVersion As Long
    szPname As String * MAXPNAMELEN
    fdwSupport As Long
    cDestinations As Long
    End Type
    Type MIXERCONTROL
    cbStruct As Long
    dwControlID As Long
    dwControlType As Long
    fdwControl As Long
    cMultipleItems As Long
    szShortName As String * MIXER_SHORT_NAME_CHARS
    szName As String * MIXER_LONG_NAME_CHARS
    lMinimum As Long
    lMaximum As Long
    Reserved(10) As Long
    End Type
    Type MIXERCONTROLDETAILS
    cbStruct As Long
    dwControlID As Long
    cChannels As Long
    item As Long
    cbDetails As Long
    paDetails As Long
    End Type
    Type MIXERCONTROLDETAILS_SIGNED
    lValue As Long
    End Type
    Type MIXERLINE
    cbStruct As Long
    dwDestination As Long
    dwSource As Long
    dwLineID As Long
    fdwLine As Long
    dwUser As Long
    dwComponentType As Long
    cChannels As Long
    cConnections As Long
    cControls As Long
    szShortName As String * MIXER_SHORT_NAME_CHARS
    szName As String * MIXER_LONG_NAME_CHARS
    dwType As Long
    dwDeviceID As Long
    wMid As Integer
    wPid As Integer
    vDriverVersion As Long
    szPname As String * MAXPNAMELEN
    End Type
    Type MIXERLINECONTROLS
    cbStruct As Long
    dwLineID As Long
    dwControl As Long
    cControls As Long
    cbmxctrl As Long
    pamxctrl As Long
    End Type
    Public i As Integer, j As Integer, rc As Long, msg As String * 200, hWaveIn As Long
    Public Const NUM_BUFFERS = 2
    Public format As WAVEFORMAT, hmem(NUM_BUFFERS) As Long, inHdr(NUM_BUFFERS) As WAVEHDR
    Public Const BUFFER_SIZE = 8192
    Public Const DEVICEID = 0
    Public fRecording As Boolean
    Function GetControl(ByVal hmixer As Long, ByVal componentType As Long, ByVal ctrlType As Long, ByRef mxc As MIXERCONTROL) As Boolean
    ' This function attempts to obtain a mixer control. Returns True if successful.
    Dim mxlc As MIXERLINECONTROLS
    Dim mxl As MIXERLINE
    Dim hmem As Long
    Dim rc As Long
    mxl.cbStruct = Len(mxl)
    mxl.dwComponentType = componentType
    ' Obtain a line corresponding to the component type
    rc = mixerGetLineInfo(hmixer, mxl, MIXER_GETLINEINFOF_COMPONENTTYPE)
    If (MMSYSERR_NOERROR = rc) Then
    mxlc.cbStruct = Len(mxlc)
    mxlc.dwLineID = mxl.dwLineID
    mxlc.dwControl = ctrlType
    mxlc.cControls = 1
    mxlc.cbmxctrl = Len(mxc)
    ' Allocate a buffer for the control
    'hmem = GlobalAlloc(&amp;H40, Len(mxc))
    hmem = GlobalAlloc(GMEM_FIXED, Len(mxc))
    mxlc.pamxctrl = GlobalLock(hmem)
    mxc.cbStruct = Len(mxc)
    ' Get the control
    rc = mixerGetLineControls(hmixer, mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE)
    If (MMSYSERR_NOERROR = rc) Then
    GetControl = True
    ' Copy the control into the destination structure
    CopyStructFromPtr mxc, mxlc.pamxctrl, Len(mxc)
    Else
    GetControl = False
    End If
    GlobalFree (hmem)
    Exit Function
    End If
    GetControl = False
    End Function
    ' Function to process the wave recording notifications.
    Sub waveInProc(ByVal hwi As Long, ByVal uMsg As Long, ByVal dwInstance As Long, ByRef hdr As WAVEHDR, ByVal dwParam2 As Long)
    If (uMsg = MM_WIM_DATA) Then
    If fRecording Then
    rc = waveInAddBuffer(hwi, hdr, Len(hdr))
    End If
    End If
    End Sub
    ' This function starts recording from the soundcard. The soundcard must be recording in order to
    ' monitor the input level. Without starting the recording from this application, input level
    ' can still be monitored if another application is recording audio
    Function StartInput() As Boolean
    If fRecording Then
    StartInput = True
    Exit Function
    End If
    format.wFormatTag = 1
    format.nChannels = 1
    format.wBitsPerSample = 8
    format.nSamplesPerSec = 8000
    format.nBlockAlign = format.nChannels * format.wBitsPerSample / 8
    format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign
    format.cbSize = 0
    For i = 0 To NUM_BUFFERS - 1
    hmem(i) = GlobalAlloc(&amp;H40, BUFFER_SIZE)
    inHdr(i).lpData = GlobalLock(hmem(i))
    inHdr(i).dwBufferLength = BUFFER_SIZE
    inHdr(i).dwFlags = 0
    inHdr(i).dwLoops = 0
    Next
    rc = waveInOpen(hWaveIn, DEVICEID, format, 0, 0, 0)
    If rc &lt;&gt; 0 Then
    waveInGetErrorText rc, msg, Len(msg)
    MsgBox msg
    StartInput = False
    Exit Function
    End If
    For i = 0 To NUM_BUFFERS - 1
    rc = waveInPrepareHeader(hWaveIn, inHdr(i), Len(inHdr(i)))
    If (rc &lt;&gt; 0) Then
    waveInGetErrorText rc, msg, Len(msg)
    MsgBox msg
    End If
    Next
    For i = 0 To NUM_BUFFERS - 1
    rc = waveInAddBuffer(hWaveIn, inHdr(i), Len(inHdr(i)))
    If (rc &lt;&gt; 0) Then
    waveInGetErrorText rc, msg, Len(msg)
    MsgBox msg
    End If
    Next
    fRecording = True
    rc = waveInStart(hWaveIn)
    StartInput = True
    End Function
    ' Stop receiving audio input on the soundcard
    Sub StopInput()
    fRecording = False
    waveInReset hWaveIn
    waveInStop hWaveIn
    For i = 0 To NUM_BUFFERS - 1
    waveInUnprepareHeader hWaveIn, inHdr(i), Len(inHdr(i))
    GlobalFree hmem(i)
    Next
    waveInClose hWaveIn
    End Sub
    Error if using winmm.dll, kernel32  in x64 mode 

  • HELP!!! VBA & Essbase Add-in for Excel

    HelloI am trying to automate some spreadsheets in excel using some vba code. I am able to use code to connect and retrieve, but i would like to be albe to select zoom functions from "Options" on the Essbase menu. Does anyone know how to do this?The code i use to connect is as follows:Declare Function EssVConnect Lib "ESSEXCLN.XLL" (ByVal sheetname As Variant, ByVal username As Variant, ByVal password As Variant, ByVal server As Variant, ByVal application As Variant, ByVal database As Variant) As LongThen to execute this code i have the following:x = EssVConnect(Null, "username", "password", "192.168.0.1", "Tech_99r", "Tech_99r")I hope this is clear, if not then reply and i will try and make this clearer.

    The VBA commands you are looking for are EssVZoomIn and EssVZoomOut.In Excel (with spreadsheet addin active) go to Help > Essbase Help.Expand the section titled "Essbase Spreadsheet Toolkit", then expand the section "Visual Basic for Applications Functions", lastly, expand the section "VBA Functions from A to Z".There you will find all the different comands available through the Spreadsheet toolkit and the proper syntax for each.

  • Can anyone recommended an app for excel spreadsheet. One that I can username iPad that can do the same functions as excel of desktop,or laptop ??

    Can anyone recommended an app for excel spreadsheet. One that I can username iPad that can do the same functions as excel of desktop,or laptop ??

    Thanks for the advice. Just don't want to waste money on apps trying to get the right on. Not looking to do too much, just add filters maybe create a pie chart. Will the app you mentioned give added sums at the end of the spreadsheet like it would on the windows version?

  • BEx formula change not working in existing Analysis for Olap/Analysis for Excel reports

    Hello all,
    I posted this in Analysis for OLAP, but there has been no response so I'm hoping perhaps you BEx experts can help me.
    I had to modify a formula in a Bex query to have it calculate the results of the formula by summation.
    I checked the query using BEx Analyzer and it summed correctly.  If I create a new analysis for olap report, it sums correctly.
    If I modify an existing report, it does not pick up the change.  Existing Analysis for Excel reports also do not pick up the new summary calculation.
    Using the CMC, I edited the connection and reselected the Bex query, but that did not work either.
    Here it is working in the query:
    Line Discount is a formula with logic checking to see if "product list price total amount" is 0, set the line discount to 0; otherwise calculate it as "product list price total amount" - Net Sale.  So the total needs to sum of the line discounts (0+2820+2820 = 5640) and not be the Overall result "product list price total amount" - Overall Result "net sale" (13960-96720= -82760).
    Here it is in an existing Webi report - working:
    Here is what is happening in an existing Analysis for OLAP report - not working:
    I also tried to unselect Line Discount as a key figure from the existing report and reselect it, but that did not work.
    I'd like to find a solution so that all the reports that use this query won't have to be rewritten.
    I'm on BW 7.0 EP 1 SP 10 and BI 4.0 SP7 Patch 5.
    Thank you for your help,
    Susan

    Hi,
    Apply Exception aggregation on line discount formula--Exception aggregation as Total---Reference characteristic as Promega product.
    Make sure to refresh the webi report once after the changes has been done.
    If this does not work then you can apply summation calculation for that column at webi level as well.
    Regards,
    AL

  • COPY TO EXCEL FUNCTION FOR MB5L

    ENHANCE THE COPY TO EXCEL FUNCTION FOR MB5L REPORT SO THAT THE DATA IS STRAIGHT AWAY TRANSFERRED TO EXCEL FILE IN PROPER COLUMNS AND VALUES.
    BEST REGARDS
    PANKAJ

    Hi Pankaj,
    Execute MB5L, then 
    go to list-Save-File-Spread sheet- Give file name and generate.
    Hope it helps.
    Uts

  • Bex variables not surfacing in analysis for excel

    Hello Gurus
    We are in BO 4.0 and BW 7.1. We have some variables(istep =1) used in a bex report and we have a workbook of analysis edtion for excel on top of this bex report. The bex variables work fine first time but when the data changes these variables are still showing the old data, they are not getting the  refreshed data. Can anyone please help me on this. Thanks in advance.

    First install the latest SP. Second enable "refresh data on report opening" on your report. This makes sure the workbook refreshes the data displayed each time you open the report. Third try to delete the crosstab and reinsert the crosstab.
    Hope that helps!

  • Additional Controls vba for Excel "problem"

    Additional Controls vba for Excel "problem" Failure to appear when you press its button. I am using Office 2013 and Windows OS 8 (32bit).
    Note
    should
    focus on, I
    use Office
    2013
    - the
    system
    Windows 8
    (32-bit).
    Please help me, and accept a multitude of thanks and respect..

    Hi ghass
    Your question is not belong to the current Windows Store App dev forum.
    To help you move the thread to the correct forum, I would ask you some questions: Is your issue a build-in ActiveX control issue?
    I will move your thread to either OfficeDev forum or Office consumer forum.
    Thanks for your understanding.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem for Report Generation Toolkit for excel 2000

    Hi all,
    Now I am Developing my program with Report Generation Toolkit 1.1.0 and Labview 7.1.
    In my computer I am using Excel XP, and there is not any problem. But when I build to
    a exe file, and use in a computer with Excel 2000, it didn't work.
    And I try to check the source file in this computer, I found that there any some connection
    error. And this is caused by the active X class. As I know Excel 2000 is using Microsoft Excel
    Object Library 9.0, but i cannot find it in the list of active x. So it is using Microsoft Excel Object
    Library with a very old verison. So in the property node there are missing functions, such as the
    UsedRange in _Worksheet in the Excel_Get_Range.vi. However, In VBA, I can find the 9.0 Library.
    Is it the problem of 9.0 library? How can I solve the problem? How can I upgrade the library to 10.0?
    Thanks.
    Regard,
    Ryan

    Hi Mike,
    Since my program is for all the staff in office, everyone may use it.
    I cannot call the whole office to upgrade the excel to XP.
    And I think Report Generation Toolkit is alway support Excel 2000,
    since the old version of it is not support for Excel XP.
    Regard,
    Ryan

Maybe you are looking for