How to Select Members Based on Attributes using Excel VBA

Hi there,Does anyone know how to select members based on attributes using Excel VBA?I don't seem to be able to find macros or functions to do that.Panda

you can use the Range or the Cells objects to get a reference to your range values
in this sample the data is on A1 to B5
Dim lineList(4)
lineList(0) = Array(Cells(1, 1).Value, Cells(1, 2).Value)
lineList(1) = Array(Cells(2, 1).Value, Cells(2, 2).Value)
lineList(2) = Array(Cells(3, 1).Value, Cells(3, 2).Value)
lineList(3) = Array(Cells(4, 1).Value, Cells(4, 2).Value)
lineList(4) = Array(Cells(5, 1).Value, Cells(5, 2).Value)

Similar Messages

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • Copying Graphs and Pie Charts generated in Analysis View to Email item using Excel VBA Macro Code

    Hi
    I am currently working on an exce VBA macro code that would help me take snapshots of the Graphs and Pie charts generated in QC for a particular application and copy the same to an email item using excel VBA macro code.
    I was able to write the code to create an email item. But I have no clue of how i can take snapshot of the graphs in Analysis View using excel VBA
    Any help would be highly appreciated.
    Thanks in Advance
    Regards
    Amit

    useramit,
    You are in the consumer end products forum.  You will also want to ask your question over at the Enterprise Business Community.
    Click the plus sign (+) next to Discussion Boards to drop down all the options for servers, networking and any other professionally related problems.
    http://h30499.www3.hp.com/

  • How to select records based on Max/Min on different columns and group by

    I have a table with 5 columns(a,b,c,d,e), i need to select records based on MAX(c),Max(D) and Min(e) group by a,b. i am trying using : select max(c),max(d),min(e) from table group by a,b. this is not working. its giving me 1 6 1
    a b c d e
    1 1 1 2 1
    1 1 1 6 4
    1 1 1 6 3
    when i group by a,b i am expecting the record 1 6 3
    Please help me with this.. Thanks in advance....

    Hi,
    Welcome to the forum!
    962163 wrote:
    I have a table with 5 columns(a,b,c,d,e), i need to select records based on MAX(c),Max(D) and Min(e) group by a,b. i am trying using : select max(c),max(d),min(e) from table group by a,b. this is not working. its giving me 1 6 1
    a b c d e
    1 1 1 2 1
    1 1 1 6 4
    1 1 1 6 3
    when i group by a,b i am expecting the record 1 6 3It looks to me like "1 6 1" is the correct answer. You're asking for the lowest value of e, and 1 is lower than 3.
    Maybe you don't want MIN (e). Explain why you want 3 (that is, how you decided that 3 is the correct value for the last column) and someone will help you code it.
    Edited by: Frank Kulash on Sep 28, 2012 6:17 PM
    Whenever you have a problem, you should psot CREATE TABLE and INSERT statements for your sample data. That way, the people who want to help you can re-create the problem and test their ideas. It often helps to clarify the problem, too. since this is your first message, I'll do it for you:
    CREATE TABLE     table_x
    (       a     NUMBER
    ,     b     NUMBER
    ,     c     NUMBER
    ,     d     NUMBER
    ,     e     NUMBER
    INSERT INTO table_x (a, b, c, d, e) VALUES (1, 1, 1, 2, 1);
    INSERT INTO table_x (a, b, c, d, e) VALUES (1, 1, 1, 6, 4);
    INSERT INTO table_x (a, b, c, d, e) VALUES (1, 1, 1, 6, 3);
    COMMIT;

  • How to select a record and delete using sereen painter in alv

    Hi experts i have displayed a table in selection sereen
    in alv by using table control(sereen painter).
    My request is to display the database table records
    when i press F8.
    I also have two buttons one is 'DELETE'
    and another one is 'INSERT'.
    My request is i have to select a particular record in
    the output and if i press the 'delete' button means
    then the selected record should be deleted in that table
    and also in database table.
    Like if i insert a new record means then the record
    should be inserted in that table and database table...
    Kindly plz send the coding immediately............

    Hi,
    create a module in ur  PROCESS AFTER INPUT fro eg
    MODULE select.
    select * from db into table itab.
    module delete.
    db-field = wa-field(this is the field u r going to delete in ur  table control and in database table).
    append wa to itab.
    delete <db table> from itab.
    module insert.
    db-field = wa-field(this is the field u r going to insert in ur table control and database table )
    append wa to itab.
    insert <db table> from itab.
    regards,
    dhaya..

  • How to change the status of test cases in Test Plan from Design to Ready using Excel VBA

    HI,
    How to change the status of test cases in Test Plan from Design to Ready using Excel VBA

    Thanks Florin,
    Your piece of code has worked alot, and it was very helpful in changing the Status of the Workitem to "READY" for all the Users fo the workitem.
    Points have been rewarded for your help.
    Process: We have acheived this using the "Work Item Exits", Usng "AFTER_EXECUTION" Method.
    Note: The Exit will be executed if "exit_cancelled"  statement is present/used in the work item method. if not it is not taking to the exit code. I'm unable to find the reason for it. Florin can u please explain this point.
    Please check the link for adding the code in Work Item Exits.
    http://wiki.sdn.sap.com/wiki/display/ABAP/ProgramExitsIn+Workflow
    Please find the Code:
    method IF_SWF_IFS_WORKITEM_EXIT~EVENT_RAISED.
    Get the context of the workitem
      me->wi_context = im_workitem_context.
    After execution of the workitem call the method AFTER_EXECUTION
      if im_event_name eq swrco_event_after_execution.
        me->after_execution( ).
      endif.
    endmethod.
    METHOD AFTER_EXECUTION.
    This method acts as the Event Handler for SWRCO_EVENT_AFTER_EXECUTION
      DATA: LCL_L_WID TYPE SWW_WIID,
            L_STATUS TYPE SWR_WISTAT-STATUS,
            L_NEW_STATUS  TYPE SWR_WISTAT,
            L_SWR_MESSAG  TYPE STANDARD TABLE OF SWR_MESSAG,
            L_SWR_MSTRUC  TYPE STANDARD TABLE OF SWR_MSTRUC.
    Get work item
      CALL METHOD WI_CONTEXT->GET_WORKITEM_ID
        RECEIVING
          RE_WORKITEM = LCL_L_WID.
      L_STATUS = 'READY'.
      CALL FUNCTION 'SAP_WAPI_SET_WORKITEM_STATUS'
        EXPORTING
          WORKITEM_ID    = LCL_L_WID
          STATUS         = L_STATUS
          USER           = SY-UNAME
          LANGUAGE       = SY-LANGU
          DO_COMMIT      = 'X'
        IMPORTING
          NEW_STATUS     = L_NEW_STATUS
         RETURN_CODE    = SY-SUBRC
        TABLES
          MESSAGE_LINES  = L_SWR_MESSAG
          MESSAGE_STRUCT = L_SWR_MSTRUC.
      IF SY-SUBRC EQ 0.
      ENDIF.
    ENDMETHOD.
    Thank You Once Again,
    Ajay Kumar Chippa

  • How to set task type of a task in MS Project using excel vba code.

    Hello Gurus,
    I am generating MS Project files(.mpp) files form excel data. An excel macro in the excel file will read the excel data and will generate the .mpp file. It is working fine. now i want to set the task type of all the tasks to "Fixed work" from excel
    vba code.
    How to use the property PjTaskFixedType in setting the task type??
    refer below links
    http://msdn.microsoft.com/en-us/library/office/ff861713.aspx
    http://msdn.microsoft.com/en-us/library/office/ff864157.aspx
    Can someone help me in setting task type property from excel vba.
    I have attached my sample code used to generate the mpp file. It is not the complete code but you will get an idea from it.
    Set pjApp = CreateObject("MSProject.Application")
    pjApp.FileNew
    Set newproj = pjApp.ActiveProject
    newproj.Tasks.Add (task_name)
    newproj.Tasks(mpp_row_number).Start = task_start_date
    newproj.Tasks(mpp_row_number).Finish = task_end_date
    newproj.Tasks(mpp_row_number).ResourceNames = resource_name
    pjApp.FileSaveAs mpp_file_save_path & mpp_file_name & ".mpp"
    pjApp.FileClose
    pjApp.Quit
    Any help is appreciated.

    Hi Syamku,
    A simple example that sets the task type:
    ActiveProject.Tasks(2).Type = pjFixedDuration
    ActiveProject.Tasks(3).Type = pjFixedUnits
    ActiveProject.Tasks(4).Type = pjFixedWork
    http://msdn.microsoft.com/en-us/library/office/ff860469(v=office.15).aspx
    Hope this helps

  • How to download data using excel vba.

    I'm trying to download data from web sites to excel using VBA.  I've found a bunch of resources like this one on stackoverflow, but they all refer to excel being run on windows.
    Does anyone know how to either scrape data or to use an API to pull data into excel?

    for exemple using
    MS_EXCEL_OLE_STANDARD_DAT

  • Using Excel VBA to Print to PDF File?

    Hi, All !!
    I have an Excel VBA application that creates Excel reports.  These need to be sent external to our company in PDF format.  I've downloaded the Acrobat SDK and have found the VB sample for AdobePDFSilent.  Unfortunately, it appears that this is written for VB or VB.Net as I don't have any of the data types available that are created in the code.  However, from another forum, I've gotten some VB code that appears to do many of the processes included in the SDK sample.
    The code below doesn't give me any errors, but no PDF file is created.
    My VBA code
    Declare Function RegOpenKeyA Lib "advapi32.dll" ( _
        ByVal Key As Long, _
        ByVal SubKey As String, _
        NewKey As Long) As Long
    Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" ( _
        ByVal hKey As Long, _
        ByVal lpValueName As String, _
        ByVal Reserved As Long, _
        ByVal dwType As Long, _
        lpData As Any, _
        ByVal cbData As Long) As Long
    Declare Function RegCloseKey Lib "advapi32.dll" ( _
        ByVal hKey As Long) As Long
    Sub TestPrintPDF()
        Dim strDefaultPrinter As String
        Dim strOutFile As String
        Dim lngRegResult As Long
        Dim lngResult As Long
        Dim dhcHKeyCurrentUser As Long
        Dim PDFPath As String
        Const dhcRegSz As Long = 1
    1    Workbooks.Open ("\\master\fnshares\bcbcm\Client Management\Client Services\New Account Fees\09 September 2010\3Q10 Rebate Ltrs\Infi\MacroTest\A02.xls")
    2    Select Case ActiveWorkbook.Sheets.Count
    3        Case 1
    4            Sheets(1).Select
    5        Case 2
    6            Sheets(Array(Sheets(1).Name, Sheets(2).Name)).Select
    7        Case 3
    8            Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name)).Select
    9        Case 4
    10            Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, Sheets(4).Name)).Select
    11        Case 5
    12           Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, Sheets(4).Name, Sheets(5).Name)).Select
    13      Case 6
    14         Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, Sheets(4).Name, Sheets(5).Name, Sheets(6).Name)).Select
    15  End Select
    16  dhcHKeyCurrentUser = &H80000001
    17  strDefaultPrinter = Application.ActivePrinter
    18  PDFPath = ActiveWorkbook.Path & Application.PathSeparator 'The directory in which you want to save the file
    19  strOutFile = PDFPath & Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & ".pdf" 'Change the pdf file name if required. This should have the fully qualified path
    20  lngRegResult = RegOpenKeyA(dhcHKeyCurrentUser, "Software\Adobe\Acrobat Distiller\PrinterJobControl", lngResult)
    21  lngRegResult = RegSetValueEx(lngResult, Application.Path & "\Excel.exe", 0&, dhcRegSz, ByVal strOutFile, Len(strOutFile))
    22  lngRegResult = RegCloseKey(lngResult)
    23  ThisWorkbook.ActiveSheet.PrintOut copies:=1, ActivePrinter:="Adobe PDF"
    24  Application.ActivePrinter = strDefaultPrinter
    25  ActiveWorkbook.Close False
    End Sub
    From what I can determine, the lines 17 & 24 combined basically accomplish the same thing as the SaveandUpdateDefaultPrinter function in the SDK (get and save the current default printer and return it to that default after printing the PDF).
    Line 20 opens the Registry key for Distiller\PrinterJobControl which is done in part of the ConvertFile function in the following SDK code.
    SDK Code
                Dim objDistillerRegKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot
                Dim strDistillerSubKey As String = "SOFTWARE\\Adobe\\Acrobat Distiller\\PrinterJobControl"
                'Open Current User's Distiller Subkey for writing
                objDistillerRegKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strDistillerSubKey, True)
    Line 21 sets the Registry key for Excel with the name of the PDF file to output which also appears to be done in part of the ConvertFile function in the following code.
    SDK Code
               If (Not objDistillerRegKey Is Nothing) Then     'set reg key value for this app and file
                    objDistillerRegKey.SetValue(strAppPath, strOutputFile)
                    objDistillerRegKey.Close()
                End If
    I have verified, using RegEdit, that this Registry key does get set with the desired output filename.
    Line 23 prints the Excel file to PDF when done manually (this was recorded using the Excel Macro Recorder).  This should be comparable to the PrintToAdobePDF function in the SDK as below.
    SDK Code
        Private Sub PrintToAdobePDF(ByVal InputfilePath As String)
            'Prints InputFilePath to the AdobePDF printer.
            'Since we just gathered all this info programmatically,
            'this function assumes the file is present, that it has an
            'associated application and that the current user has print privileges.
            'Define properties for the print process
            Dim pProcInfo As New ProcessStartInfo
            pProcInfo.FileName = InputfilePath
            pProcInfo.Verb = "Print"
            'Make process invisible
            pProcInfo.CreateNoWindow = True
            pProcInfo.WindowStyle = ProcessWindowStyle.Hidden
            'start print process
            Dim pMyProc As Process = Process.Start(pProcInfo)
            pMyProc.WaitForExit()
        End Sub
    These are some of the statements I can't do because I don't have a ProcessStartInfo type.  What am I doing wrong or NOT doing that the PDF file is not created?  I hope I've described my situation in enough, but not too much detail.  Thanks for your help.
    Nate Brei

    Reinhard & Karl Heinz,
    Thank you both for your responses and willingness to work with me on this problem.  This is driving me crazy & is getting very frustrating.  It seems that I've tried everything that people have suggested (I've also posted on a VB Forum that I subscribe to) and I'm basically doing what works for everyone else but doesn't work for me.  I've got to be close.
    Reinhard, regarding your last post, it doesn't appear to be a one-time setting.  Everytime I come into the Printers Property box (even after I've printed a PDF document manually, that option about system & document fonts is ALWAYS turned on.  If it is a registry setting, please let me know how to turn it off.  I'm using Adobe Acrobat 9 Standard.
    Karl Heinz, I've tried that based on my initial post (see the code there).  Since your post, I tried it again.  I get the same result, NO FILE is produced anywhere.
    I wish I could post pictures, but evidently I can't.  So, I going to post first my code (in case you want to try to recreate my problem), then the values of the variables in that code when I run it (so you can I have everything set correctly as far as I know), and finally, the values of the Registry entries that I have after I run it.  So, please bear with me as the post may be a little long.
    My Code
    Declare Function RegOpenKeyA Lib "advapi32.dll" ( _
        ByVal Key As Long, _
        ByVal SubKey As String, _
        NewKey As Long) As Long
    Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" ( _
        ByVal hKey As Long, _
        ByVal lpValueName As String, _
        ByVal Reserved As Long, _
        ByVal dwType As Long, _
        lpData As Any, _
        ByVal cbData As Long) As Long
    Declare Function RegCloseKey Lib "advapi32.dll" ( _
        ByVal hKey As Long) As Long
    Sub TestPrintPDF()
        Dim strDefaultPrinter As String
        Dim strOutFile As String
        Dim lngRegResult As Long
        Dim lngResult As Long
        Dim dhcHKeyCurrentUser As Long
        Dim PDFPath As String
        Const dhcRegSz As Long = 1
        'Workbooks.Open ("\\master\fnshares\bcbcm\Client Management\Client Services\New Account Fees\09 September 2010\3Q10 Rebate Ltrs\Infi\MacroTest\A02.xls")
        Workbooks.Open ("H:\A02.xls")
        Select Case ActiveWorkbook.Sheets.Count
            Case 1
                Sheets(1).Select
            Case 2
                Sheets(Array(Sheets(1).Name, Sheets(2).Name)).Select
            Case 3
                Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name)).Select
            Case 4
                Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, _
                 Sheets(4).Name)).Select
            Case 5
                Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, _
                 Sheets(4).Name, Sheets(5).Name)).Select
            Case 6
                Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, _
                 Sheets(4).Name, Sheets(5).Name, Sheets(6).Name)).Select
        End Select
        dhcHKeyCurrentUser = &H80000001
        strDefaultPrinter = Application.ActivePrinter
        'The directory in which you want to save the file
        PDFPath = ActiveWorkbook.Path & Application.PathSeparator
        'Change the pdf file name if required. This should have the fully qualified path
        strOutFile = PDFPath & Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & ".pdf"
        lngRegResult = RegOpenKeyA(dhcHKeyCurrentUser, "Software\Adobe\Acrobat Distiller\PrinterJobControl", _
            lngResult)
        lngRegResult = RegSetValueEx(lngResult, Application.Path & "\Excel.exe", 0&, dhcRegSz, _
            ByVal strOutFile, Len(strOutFile))
        lngRegResult = RegCloseKey(lngResult)
        ThisWorkbook.ActiveSheet.PrintOut copies:=1, ActivePrinter:="Adobe PDF"
        'ThisWorkbook.ActiveSheet.PrintOut copies:=1, preview:=False, ActivePrinter:="Adobe PDF", _
            printtofile:=True, collate:=True, prtofilename:=strOutFile
        'Call printToPdf(strOutFile)
        Application.ActivePrinter = strDefaultPrinter
        ActiveWorkbook.Close False
    End Sub
    Sub printToPdf(PDFFilename)
        ' Define a postscript file name
        PSFileName = "H:\TempPostScript.ps"
        ' Print the Excel range to the postscript file
        'Dim MySheet As Worksheet
        'Set MySheet = ActiveSheet
        ActiveWindow.SelectedSheets.PrintOut copies:=1, preview:=False, ActivePrinter:="Adobe PDF", _
            printtofile:=True, collate:=True, prtofilename:=PSFileName
        ' Convert the postscript file to .pdf
        Set myPDF = CreateObject("PdfDistiller.PdfDistiller.1")
        myPDF.FileToPDF PSFileName, PDFFilename, ""
    End Sub
    Values of my Variables When I Run the Code
    ? dhcHKeyCurrentUser
         -2147483647
    ? strDefaultPrinter
         \\tcps01p\FNT12W00 Canon 5020 PCL 5e on Ne04:
    ? PDFPath
         H:\
    ? strOutFile
         H:\A02.pdf
    ? lngResult
         2280
    ? Application.Path & "\Excel.exe
         C:\Program Files\Microsoft Office\OFFICE11\Excel.exe
    ? dhcRegSz
         1
    ? Len(strOutFile)
         10
    ? PSFileName
         H:\TempPostScript.ps
    ? PDFFilename
         H:\A02.pdf
    Values of my Registry Entries (HKEY_CURRENT_USER\Software\Adobe\Acrobat Distiller\PrinterJobControl)
    (Default)          REG_SZ          (value not set)
    C:\Program Files\Microsoft Office\OFFICE11\Excel.exe          REG_SZ          H:\A02.pdf
    LastPdfPortFolder - EXCEL.EXE          REG_SZ          "Q:\Client Management\Client Services\New Account Fees\09 September 2010\3Q10 Rebate Ltrs\Infi\MacroTest
    Note:  There are a couple of other entries for documents that I've printed manually that I didn't include.  Also, the last entry above, contains the value of the folder that I last manually "printed" to.
    I've also noticed that I have a Registry SubKey under PrinterJobControl called DownloadFonts.  However, the only entry there is:
         (Default) REG_SZ (value not set)
    Is this the registry key you mentioned, Reinhard?
    As you can see in my code, I have 3 different methods that I've tried to print.  The first one defaults everything after selecting the Acrobat PDF printer.  The second sets the output filename as a PDF (basically what you suggested, Karl Heinz).  The third method calls a procedure that prints to a PostScript file & then uses Distiller to print from that file to pdf.  This is the method Reinhard suggested.
    With the first 2 methods, I get NO error messages, but no file(s) show up.  With the 3 method, I get the error about the Fonts checkbox, but it creates a 0K PostScript file.  When I skip that statement and run the other 2 statements, I get a log file that says the PostScript file is empty and not PDF file was created.
    YIKES...  What's going on?  Thanks again for attempting to help me!!!
    Nate

  • How to read ssas cube and role from Excel vba

    Hi,
    I want to read all roles and cubes in SSAS Db from Excel Vba.
    1. First i want to read all the roles which was assigned to me
    2. based on the role, i have to read all cube name
    Please help me to
    accomplish this task.

    Hi Jack,
    In Analysis Services, Each role contains members, by Windows username or by Windows group, and permissions (read, process, administrator). If the user has the permission to access SSAS database, then the account was contained in one or more roles. When connect
    to SSAS database, we need to use an account to log on it, and SSAS will list all the cubes' name based on the role automatically.
    Reference
    Using Excel to interact with a SSAS cube
    Regards,
    Charlie Liao
    TechNet Community Support

  • Using Excel VBA to save PDF file as a text (plain) file?

    I'm using 8.0 Acrobat Pro.
    Third party apps are not an option (I'm restricted from installing anything on my office PC).
    I could simply save each PDF manually, but given the number of files this would not be practical.
    The text it will output does not have to be pretty by any means (and I'm aware it won't be).
    As long as I can get the PDF files in a text file format, there would be no further obstacles for me - because I would then be able to get Excel to gather-import all the data and consolidate-clean-organize everything accordingly at that point.
    What's in these PDF files are simply names, numbers, and email addresses (basic office text type data stuff simple).
    I wish to save them all as text files, and then use Excel to suck all the data from those newly created text files and consolidate-organize them accordingly.
    The VBA module I've seen referrenced around the web is the following beneath; however, I am having no luck with it.
    I keep getting the error message:
    ActiveX component can't create object or  return reference to this object (Error 429)
    I am running Microsoft Office 2010 | Excel (and using Adobe Acrobat Pro 8.0).
    Any help is extremely appreciated.
    Here is the VB code in Excel I'm having trouble with:  What this is supposed to do is simply find the specified PDF file and save it as a Plain Txt File.
    Sub Convert_PDF_To_Text_File()
    Dim AcroXApp As Object
    Dim AcroXAVDoc As Object
    Dim AcroXPDDoc As Object
    Set AcroXApp = CreateObject("AcroExch.App")
    AcroXApp.Hide
    Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")
    AcroXAVDoc.Open strPDFPath, "Acrobat"
    AcroXAVDoc.BringToFront
    Set AcroXPDDoc = AcroXAVDoc.GetPDDoc
    Dim jsObj As Object
    Set jsObj = AcroXPDDoc.GetJSObject
    jsObj.SaveAs strOutputFile, "com.adobe.acrobat.plain-text"
    AcroXAVDoc.Close False
    AcroXApp.Exit
    End Sub

    one other thought is that you can create text files with a batch process inside of acrobat.  Advanced ---> Document Processing ----> Batch Processing.
    Choose new sequence, give it a name
    Step 1: Select Commands ----> Choose "execute javascript", then hit "Add."  Click on "Execute Javascript" that was just added on the right, then hit the edit button and toss in the script below that I grabbed from the javascript samples (also, if your docs have multiple pages you'll need to embed the for loop into another for loop that cycles through each page).  You'd also want to change the name of the saved txt file to the name of pdf you're doing it to.  It shouldn't be that hard, but I'm guessing you're probably alot more familiar with VBA then javascript which is why you're choosing to do it from excel.  I'm kind of in the same boat of having written a bunch of VBA, but not much javascript.  I highly recommend investing some time into learning acrobat scripting b/c VB does have it's limitations when it comes to messing with PDF's.
    * function to extract the text content of the current page and save to a file.
    try  {
    var p = this.pageNum;
    var n = this.getPageNumWords(p);
    app.alert("Number of words in the page: " + n);
    var str = "";
    for(var i=0;i<n;i++) {
    var wd = this.getPageNthWord(p, i, false);  
    if(wd != "") str = str + wd;  
    // save the string into a data object
    this.createDataObject("whatever.txt",str); 
    // pop up a file selection box to export the data
    this.exportDataObject("whatever.txt");
    // clean up
    this.removeDataObject("whatever.txt");
    } catch (e)  { 
    app.alert(e)

  • How to select columns from internal table using 'GUI_DOWNLOAD' ?

    Hi,
    i am running a report & the fields for output is saved in an internal table which has as many as 10 fields. But I want to select only a few fields for output. There is a option COL_SELECT in function 'GUI_DOWNLOAD'. How to use it. If possible with example.

    Hai VijayKumar
    Try with the following code
    tables : mara.
    data : begin of it_mara occurs 0,
           matnr like mara-matnr,
           mbrsh like mara-mbrsh,
           mtart like mara-mtart,
           meins like mara-meins,
           end of it_mara.
    parameters : P_mtart like mara-mtart default 'ROH'.
    start-of-selection.
    perform select_data.
    perform download_data.
    *&      Form  select_data
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
    select
          matnr
          mbrsh
          mtart
          meins
          from mara into table it_mara
          where mtart = p_mtart.
    ENDFORM.                    " select_data
    *&      Form  download_data
          text
    -->  p1        text
    <--  p2        text
    FORM download_data .
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = 'c:\down.txt'
        FILETYPE                        = 'ASC'
        COL_SELECT                      = 'X'
        COL_SELECT_MASK                 = 'X XX'
      TABLES
        DATA_TAB                        = it_mara.
      IF SY-SUBRC = 0.
        SORT IT_MARA BY MATNR.
      ENDIF.
    ENDFORM.                    " download_data
    Thanks & Regards
    Sreenivasulu P

  • How to select State based on the country

    Hi All,
    I have a requirement,i have to dynamically  populate the value in State based on the Country chosen in the drop down.
    Can you please tell me how to achieve this functionality.
    Thanks & Regards,
    Malkit Singh

    Hi, Malkit
    There is  already a cotext mapping for Sate.
    Take a look at this.
    http://scn.sap.com/message/13816883#13816883
    In your case, use these data types.
    element Country  :CountryCode;
    element State   :RegionCode;
    Regards,
    Fred.

  • How to Select Data from different Tables Using Linq

    Hi,
    I have two different tables, I just want to collect data from tables using Linq to SQL Queries.
    The tables looks like This 
    ID Name ImageUrl 
    Other Table is
    ID EmpID CheckInTime CheckOutTime 
    What I want to Collect data from CheckInTime and want to place it in a that is in a list view
    Same thing I want to do it for CheckOutTime And One thing I want to tell is both tables are joined by a FK EmpID with ID.
    What Are the suggestions for me 
    I have Used this code
    var data = from emp in db.Employees
    join chk in db.CheckInCheckOuts on emp.ID equals chk.EmpID
    select new EmployeeCheckInOut
    Name = emp.Name,
    ImageUrl = emp.ImageUrl,
    CheckIn = emp.CheckInCheckOuts,
    CheckOut = emp.CheckInCheckOuts
    Here the CheckInCheckOuts is another table, I don't how do I access fields of the Other table "CheckInCheckOuts"
    Thank you
    Ali

    Mitja,
    Kind of Tables, I don't Know but I can Tell you that these are Two table, first Table Have Data in It, Name, ImageUrl I have filled this table with names and ImageUrls And are string type.Other Table is for the CheckInTime And CheckOutTime of the employee.
    What I need that when I click on the Image button it Should displays The Current Datetime into the label below the Image button.
    So I have Problem accessing my CheckInCheckOut Table because I may not have Idea about.Did you understand what I need to do, if you have more question please ask to me.
    Thanks
    Ali

  • How to select multiple row of table using check box?

    hi,
             i am having table on view having first field as checkbox. what i want, when i click on checkboxes in multiple rows, and i click on any button i need to use those content to next view...
              my problem is if i select only one row , i can use onlead select property of table..but when i select multiple rows  through check box how should i read contents of table....?
    Plz solve it.
    Thanks,
    Saurin Shah

    Hello Saurin,
    You are right using LeadSelection you can select only 1 row at a time. You will have to make use of Selection for achieving this. First you will have to change the selection mode of the table to multiple & also change the selection property for the related context to 0..n . Please find a code extract which might help you. (However this facility is only available from SP 14.) The main part is using the set_selected method of if_wd_context_node.
    data: node_zcourse_details type ref to if_wd_context_node,
             node_course_assign type ref to if_wd_context_node,
             elem_course_assign type ref to if_wd_context_element,
             stru_course_assign type if_v_details=>element_course_assign ,
             item_popin_selected like stru_course_assign-popin_selected.
    "     navigate from <CONTEXT> to <ZCOURSE_DETAILS> via lead selection
    node_zcourse_details = wd_context->get_child_node( name = if_v_details=>wdctx_zcourse_details ).
    "     navigate from <ZCOURSE_DETAILS> to <COURSE_ASSIGN> via lead selection
    node_course_assign = node_zcourse_details->get_child_node( name = if_v_details=>wdctx_course_assign ).
    "     @TODO handle not set lead selection
    if ( node_course_assign is initial ).
    exit.
    endif.
    data elem_set type wdr_context_element_set.
    field-symbols <wa_elem> like line of elem_set.
    elem_set = node_course_assign->get_elements( ).
    loop at elem_set assigning <wa_elem>.
       <wa_elem>->set_selected( TRUE OR FALSE ). " Supply either TRUE/FALSE in here
    endloop.

Maybe you are looking for