Operations on Excel files

Hi,
My current projects needs to manipulate Excel files:
- read Excel files, just a few Cells, to determine the Excel type(Internal stuff)
- convert Excel to html or csv
Except POI, would you recommend another API to perform read and conversion over excel files?
Thanks in advance.

POI is fine but it was difficult for me to get alopng with its api.
But there is also [another package|http://www.dancrintea.ro/xls-to-pdf/] which would allow you to do:
- convert xls to html, csv(as you need), bt also to pdf
- read and write xls files using simplified api methods like getCell and Cell
- it has also a nice method to set the current sheet and hide the others; this is particular useful if your calculation goes over several sheets but you want to extract/convert only a sheet with the final calculations for example, or just simply for hiding details
Just for read/write you may also consider [this one|http://jexcelapi.sourceforge.net/] . But no way to convert to csv or html as you requested.

Similar Messages

  • 'Save As' operation on an excel file (Urgent) ?

    Hi All,
    I have an excel file in my project directory. I want to save or make a copy of that excel file in the directory with a different name i.e. i want to do 'Save As' operation on it whenever user clicks some button. Thanks in advance
    Best Regards.
    Umer.
    Solved!
    Go to Solution.

    If you only want to save a file with a new name, in the button callback you can:
    (Optional) Use FileSelectPopup to let the user choose the file to operate on. Function will return the complete pathname of the file in a string variable
    Use SplitPath to extract the file name and change it accordingly with standard string functions
    Use MakePathname to rebuild the complete file pathname in a new string variable
    Use CopyFile to operate the copy
    All this does not open the file to examine its content.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to change data in decision table using excel file in operating system?

    Hello, BRF Experts
    I now brf + for the first time in the current project is being developed.
    Now, project has been facing a big problem.
    Develop system that was developed in the history of decision table in the operating system can be used to update excel file, etc. I do not know whether.
    So, I was tested, but can not change data in decision table.
    [ error message : system is not change allowed ].
    The operating system itself to the current system setting is immutable and check it
    : changes and transports for client-specific object -> no changed allowed
    : cross-client object changes -> no changes to repository and cross-client customizing object.
    Decision table in the operating system can update the details if I want to know what to do.
    Maintenance view can be modified in the operating system as a decision table, I wonder if you can create a view.
    Edited by: Sung-Wook Ha on Jan 13, 2012 2:02 PM

    Hi ,
    Exchanging data with Microsoft Excel is done with the help of the XML-based file format (file extension .XSLX) introduced with Microsoft Excel 2007. If you are using an older version of Microsoft Office, you can download the Microsoft Office Compatibility Pack to upgrade the supported file formats from the Microsoft Download Center ([Exchanging Decision Table Data With Microsoft Excel |http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466]). Once you have downloaded the Compatibility Pack, you have to install it on every workstation that has an older version of Microsoft Office installed.
    Please refer the link-
    [BRFplus-Data exchange with MS Office 2007|http://help.sap.com/erp2005_ehp_05/helpdata/en/b8/e03486d1df48c6baa3c4354f5198ee/frameset.htm]
    Hope this helps.
    Thanks,
    Ajay

  • I need to sort very large Excel files and perform other operations.  How much faster would this be on a MacPro rather than my MacBook Pro i7, 2.6, 15R?

    I am a scientist and run my own business.  Money is tight.  I have some very large Excel files (~200MB) that I need to sort and perform logic operations on.  I currently use a MacBookPro (i7 core, 2.6GHz, 16GB 1600 MHz DDR3) and I am thinking about buying a multicore MacPro.  Some of the operations take half an hour to perform.  How much faster should I expect these operations to happen on a new MacPro?  Is there a significant speed advantage in the 6 core vs 4 core?  Practically speaking, what are the features I should look at and what is the speed bump I should expect if I go to 32GB or 64GB?  Related to this I am using a 32 bit version of Excel.  Is there a 64 bit spreadsheet that I can us on a Mac that has no limit on column and row size?

    Grant Bennet-Alder,
    It’s funny you mentioned using Activity Monitor.  I use it all the time to watch when a computation cycle is finished so I can avoid a crash.  I keep it up in the corner of my screen while I respond to email or work on a grant.  Typically the %CPU will hang at ~100% (sometimes even saying the application is not responding in red) but will almost always complete the cycle if I let it go for 30 minutes or so.  As long as I leave Excel alone while it is working it will not crash.  I had not thought of using the Activity Monitor as you suggested. Also I did not realize using a 32 bit application limited me to 4GB of memory for each application.  That is clearly a problem for this kind of work.  Is there any work around for this?   It seems like a 64-bit spreadsheet would help.  I would love to use the new 64 bit Numbers but the current version limits the number of rows and columns.  I tried it out on my MacBook Pro but my files don’t fit.
    The hatter,
    This may be the solution for me. I’m OK with assembling the unit you described (I’ve even etched my own boards) but feel very bad about needing to step away from Apple products.  When I started computing this was the sort of thing computers were designed to do.  Is there any native 64-bit spreadsheet that allows unlimited rows/columns, which will run on an Apple?  Excel is only 64-bit on their machines.
    Many thanks to both of you for your quick and on point answers!

  • Are operating files only within Windows (C:) or are Word and Excel files ok in Documents and (C:) folders in 8.1?

    A Microsoft tech said "oh-oh" when he saw Word and Excel files, and I think other files, in Windows (C:). He said only operating files should be in that folder or a user might delete an operating file by mistake. I have Word and Excel files in
    both (C:) and Documents folders. There is some overlap but there are different files in each. When I open a Word file it defaults to (C:) not Documents. Sometimes default location is SkyDrive. So unpredictability is my experience. The questions are what is
    correct default and how to make it so.
    Microsoft store in San Diego transferred files from old computer to new one and this default is how the computer was set up.

    Hi, Tyro.
    What a mess. Usually system files in the Windows folder are protected from being deleted by users, but not all of them.
    Here are some ideas:
    Go back to the Microsoft store and tell them to fix it. They caused it, it was their mistake, they are responsible to fix it.
    If that is not possible because they are too far away... find another Microsoft Store if possible and have them fix it.
    Last resort: If it was me, I'd just back up all the files that I care about onto my SkyDrive (now OneDrive) account or a reliable thumb drive. Then do a factory re-image. Maybe back up the files and make the MS store do it. If I had purchased Office
    2013 (it sounds like you have Office 2013), then I would have them reinstall that as well.
    Keep the store involved because it is their fault.
    At least call the MS store in San Diego and ask them what they suggest. Put them on the spot. They are the ones that screwed up and are responsible for the copying process.
    Good luck!
    Best wishes, Davin Mickelson

  • How to upload Sales Orders into B1 from an excel file?

    Hi,
      I'm a new comer. I'm looking for a program of uploading Sales Orders into B1 from an excel file. Where can I find a reference book for it? Or I appreciate if someone could offer a program sample.
      Thanks
      ZAP

    Hello ZAP.
    I do not have such code, but i this link /people/janos.nagy/blog/2010/01/25/exporting--importing-authorization-using-ms-excel-in-sap-b1 you can find an excel example about authorization, and using Single Sign On (SAP B1 must have run with excel)
    The method is similar, you can run any DI API operation from excel.
    Here is an example to add a sales order
    Dim oDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
            oDoc.CardCode = CUSTOMER_CODE
            oDoc.DocDate = Today
            oDoc.DocDueDate = Today
            oDoc.Lines.SetCurrentLine(0)
            oDoc.Lines.ItemCode = ITEMCODE
            oDoc.Lines.Quantity = QTY
            oDoc.Lines.UnitPrice = PRICE
            If oDoc.Add <> 0 Then
                MsgBox("Error " + oCompany.GetLastErrorDescription())
            Else
                MsgBox("SAles order added")
            End If
    You can repeat the setcurrentline section as many time as lines you have in the SO:
    Regards,
    J.
    Ps: Reference: SDK help and sample programs, which included in every patch.
    Edited by: János Nagy on Feb 10, 2010 9:50 AM

  • Need a script to update AD information from Excel file, however employee ID is use for identify the user in AD

    Please help me to get this done!....Thanks in Advance
    This is current script I use to update AD record but its taking user id to pick the user in AD, which is some time give error not update properly..
    # UpdateUsers.ps1
    # PowerShell program to update Active Directory users from the information in a
    # Microsoft Excel spreadsheet. Only single-valued string attributes supported.
    # Author: Richard Mueller
    # PowerShell Version 1.0
    # September 12, 2011
    Trap
        If ("$_".StartsWith("Cannot load COM type Excel.Application"))
            "Excel application not found, program aborted"
            Add-Content -Path $LogFile -Value "## Excel application not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If (("$_".StartsWith("Exception has been thrown")) -and ($Step -eq "4"))
            "Excel spreadsheet not found, program aborted"
            Add-Content -Path $LogFile -Value "## Excel spreadsheet not found: $ExcelPath"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If ("$_".StartsWith("The server is not operational"))
            "Domain Controller not found, program aborted"
            Add-Content -Path $LogFile -Value "## Domain Controller not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If ("$_".StartsWith("The directory service is unavailable"))
            "Active Directory not found, program aborted"
            Add-Content -Path $LogFile -Value "## Active Directory not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If ("$_".StartsWith("The specified domain"))
            "Domain not found, program aborted"
            Add-Content -Path $LogFile -Value "## Domain not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        "Unexpected error: $_"
        Add-Content -Path $LogFile -Value "## Unexpected error: $_"
        Add-Content -Path $LogFile -Value "   Step: $Step"
        Break
    Function CleanUp
        Trap
            "Error during cleanup: $_"
            Add-Content -Path $LogFile -Value "## Error during cleanup: $_"
            $Script:Errors = $Script:Errors + 1
            Continue
        # Function to release Excel objects from memory.
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Columns)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Rows)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Range)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Sheet)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Worksheets)} While ($x -gt -1)
        $Workbook.Close($False)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Workbook)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Workbooks)} While ($x -gt -1)
        $Excel.Quit()
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Excel)} While ($x -gt -1)
    # Specify paths to spreadsheet and log file.
    $Script:Errors = 0
    $Step = "1"
    $ExcelPath = "c:\scripts\UpdateUsers.xls"
    $LogFile = "c:\scripts\UpdateUsers.log"
    Write-Host "Please Standby..."
    # Add to the log file.
    $Step = "2"
    Add-Content -Path $LogFile -Value "------------------------------------------------" -ErrorAction Stop
    Add-Content -Path $LogFile -Value "UpdateUsers.ps1 Version 1.0 (September 12, 2011)"
    Add-Content -Path $LogFile -Value $("Started: " + (Get-Date).ToString())
    Add-Content -Path $LogFile -Value "Spreadsheet: $ExcelPath"
    Add-Content -Path $LogFile -Value "Log file: $LogFile"
    $Step = "3"
    # Open specified Excel spreadsheet.
    $Excel = New-Object -ComObject "Excel.Application"
    $Workbooks = $Excel.Workbooks
    $Step = "4"
    $Workbook = $Workbooks.Open($ExcelPath)
    $Worksheets = $Workbook.Worksheets
    $Sheet = $Worksheets.Item(1)
    $Range = $Sheet.UsedRange
    $Rows = $Range.Rows
    $Columns = $Range.Columns
    $Step = "5"
    # Hash table of attribute syntaxes.
    # The LDAP display names will be read from the spreadsheet.
    # The corresponding syntaxes will be read from the Schema container.
    $Attributes = @{}
    # Array of spreadsheet column headings.
    $Cols = @()
    $Step = "6"
    # Read attribute LDAP Display Names from the first row of the spreadsheet.
    $ID = 0
    For ($k = 1; $k -le $Columns.Count; $k = $k + 1)
        # Retrieve column heading, the lDAPDisplayName of an attribute.
        $Value = $Sheet.Cells.Item(1, $k).Text
        # Keep track of all column headings.
        $Cols += $Value
        # Skip duplicates in hash table.
        If ($Attributes.ContainsKey($Value) -eq $False)
            # Default is "NotFound", until found in the AD Schema.
            $Attributes.Add($Value, "NotFound")
        # Keep track of which column uniquely identifies users.
        If ($Value.ToLower() -eq "distinguishedname") {$ID = $k}
        If (($Value.ToLower() -eq "samaccountname") -and ($ID -eq 0)) {$ID = $k}
        # This script cannot be used to rename users.
        If ($value.ToLower() -eq "cn")
            Add-Content -Path $LogFile -Value "## This script cannot be used to rename users"
            Add-Content -Path $LogFile -Value "   Do not specify the cn attribute in the spreadsheet"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            CleanUp
            Return "Program aborted: cn attribute found in spreadsheet" `
                + "`nSee log file: $LogFile"
    $Step = "7"
    If ($ID -eq 0)
        Add-Content -Path $LogFile -Value "## No column found to identify users"
        Add-Content -Path $LogFile -Value "   One column must be distinguishedName or sAMAccountName"
        Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
        CleanUp
        Return "Program aborted: No column found in spreadsheet to identify users" `
            + "`nSee log file: $LogFile"
    # Create filter to query for attributes in the schema.
    $Attrs = $Attributes.Keys
    $Filter = "(&(objectCategory=AttributeSchema)(|"
    ForEach ($Attr In $Attrs)
        $Filter = $Filter + "(lDAPDisplayName=$Attr)"
    $Filter = $Filter + "))"
    $Step = "8"
    $RootDSE = [System.DirectoryServices.DirectoryEntry]([ADSI]"LDAP://RootDSE")
    $Domain = $RootDSE.Get("defaultNamingContext")
    $Schema = $RootDSE.Get("schemaNamingContext")
    $Step = "9"
    # Use the NameTranslate object.
    $objTrans = New-Object -comObject "NameTranslate"
    $objNT = $objTrans.GetType()
    # Initialize NameTranslate by locating the Global Catalog.
    $objNT.InvokeMember("Init", "InvokeMethod", $Null, $objTrans, (3, $Null))
    $Step = "10"
    # Retrieve NetBIOS name of the current domain.
    $objNT.InvokeMember("Set", "InvokeMethod", $Null, $objTrans, (1, "$Domain"))
    $NetBIOSDomain = $objNT.InvokeMember("Get", "InvokeMethod", $Null, $objTrans, 3)
    Add-Content -Path $LogFile -Value "NetBIOS name of domain: $NetBIOSDomain"
    $Step = "11"
    $Searcher = New-Object System.DirectoryServices.DirectorySearcher
    $Searcher.SearchRoot = [ADSI]"LDAP://$Schema"
    $Searcher.PageSize = 200
    $Searcher.SearchScope = "subtree"
    $Searcher.PropertiesToLoad.Add("lDAPDisplayName") > $Null
    $Searcher.PropertiesToLoad.Add("attributeSyntax") > $Null
    $Searcher.PropertiesToLoad.Add("isSingleValued") > $Null
    $Searcher.PropertiesToLoad.Add("systemFlags") > $Null
    # Filter on specified attributes.
    $Searcher.Filter = $Filter
    $Step = "12"
    # Query Active Directory.
    $Results = $Searcher.FindAll()
    # Enumerate recordset.
    ForEach ($Result In $Results)
        # Retrieve properties of attributes.
        $Name = $Result.Properties.Item("lDAPDisplayName")[0]
        $SysFlags = $Result.Properties.Item("systemFlags")[0]
        $SyntaxNum = $Result.Properties.Item("attributeSyntax")[0]
        $SingleValued = $Result.Properties.Item("isSingleValued")[0]
        # Only single-valued string attributes supported by this version of the program.
        Switch ($SyntaxNum)
            "2.5.5.12" {$Syntax = "String"}
            Default {$Syntax = "NotSupported"}
        If ($Name.ToLower() -eq "distinguishedname") {$Syntax = "DN"}
        If (($SysFlags -band 4) -ne 0)
            $Attributes[$Name] = "Constructed"
        Else
            If ($SingleValued -eq $True)
                $Attributes[$Name] = $Syntax
            Else
                $Attributes[$Name] = "NotSupported"
    $Step = "13"
    # Check if any attributes not found or have unsupported syntax.
    $Found = $True
    ForEach ($Attr In $Attrs)
        $Syntax = $Attributes[$Attr]
        If ($Syntax -eq "NotFound")
            Add-Content -Path $LogFile -Value "## Attribute $Attr not found in schema"
            "Attribute $Attr not found in schema"
            $Found = $False
        If ($Syntax -eq "NotSupported")
            Add-Content -Path $LogFile -Value "## Attribute $Attr has a syntax that is not supported"
            "Attribute $Attr has a syntax that is not supported"
            $Found = $False
        If ($Syntax -eq "Constructed")
            Add-Content -Path $LogFile -Value "## Attribute $Attr is operational, so is not supported"
            "Attribute $Attr is operational, so is not supported"
            $Found = $False
    $Step = "14"
    If ($Found -eq $False)
        Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
        CleanUp
        Return "Program aborted" `
            + "`nSee log file: $LogFile"
    # Read remaining rows of the spreadsheet, until the first blank value is found
    # in the column that identifies users.
    $Step = "15"
    $Script:Updated = 0
    $Script:Unchanged = 0
    $j = 2
    Do {
        # Retieve ID value for the user first.
        $Value = $Sheet.Cells.Item($J, $ID).Text
        $Found = $False
        $Step = "16"
        If ($Cols[$ID - 1] -eq "distinguishedname")
            # Any forward slash characters must be escaped.
            $DN = $Value.Replace("/", "\/")
            # Bind to the user object.
            # If user not found, $User.Name will be $Null.
            $User = [ADSI]"LDAP://$DN"
            If ($User.Name -ne $Null)
                $Found = $True
        $Step = "17"
        If ($Cols[$ID - 1] -eq "samaccountname")
            Trap
                Write-Host ""
                "Error translating name: $_"
                Add-Content -Path $LogFile -Value "## Error translating name $Value"
                Add-Content -Path $LogFile -Value "   Description: $_"
                $Script:Errors = $Script:Errors + 1
                Continue
            # Convert sAMAccountName to distinguishedName.
            $DN = ""
            $Step = "18"
            $objNT.InvokeMember("Set", "InvokeMethod", $Null, $objTrans, (3, "$NetBIOSDomain$Value"))
            $DN = $objNT.InvokeMember("Get", "InvokeMethod", $Null, $objTrans, 1)
            $Step = "19"
            If ($DN -ne "")
                $Step = "20"
                # Any forward slash characters must be escaped.
                $DN = $DN.Replace("/", "\/")
                # Bind to the user object.
                $User = [ADSI]"LDAP://$DN"
                $Found = $True
        If ($Found -eq $True)
            $Step = "21"
            # Read remaining values for this user.
            $Changed = $False
            For ($k = 1; $k -le $Columns.Count; $k = $k + 1)
                # Skip the identifying column.
                If ($k -ne $ID)
                    $Step = "22"
                    # Retrieve attribute name for this column from array.
                    $AttrName = $Cols[$k - 1]
                    # Retrieve attribute syntax from hash table.
                    $Syntax = $Attributes[$AttrName]
                    $Step = "23"
                    # Retrieve attribute value for this user.
                    $Value = $Sheet.Cells.Item($j, $k).Text
                    # Skip blank values.
                    If ($Value -ne "")
                        If ($Syntax -eq "String")
                            Trap
                                If ("$_".StartsWith("The directory property cannot be found"))
                                    Continue
                                Else
                                    Write-Host ""
                                    "Error retrieving value from Active Directory: $_"
                                    Add-Content -Path $LogFile -Value "## Error retrieving $AttrName for user $DN"
                                    Add-Content -Path $LogFile -Value "   Description: $_"
                                    $Script:Errors = $Script:Errors + 1
                                    Continue
                            $Step = "24"
                            # Single-valued string attribute.
                            # Retrieve existing value.
                            $OldValue = ""
                            $OldValue = $User.Get($AttrName)
                            # Check if existing value to be deleted.
                            If ($Value.ToLower() -eq ".delete")
                                If ($OldValue -ne "")
                                    If ($AttrName.ToLower -eq "samaccountname")
                                        Add-Content -Path $LogFile -Value `
                                            "## Mandatory attribute sAMAccountName cannot be cleared for user: $DN"
                                        $Script:Errors = $Script:Errors + 1
                                    Else
                                        Trap
                                            Write-Host ""
                                            "Error deleting value from Active Directory: $_"
                                            Add-Content -Path $LogFile -Value "## Error deleting $AttrName for user $DN"
                                            Add-Content -Path $LogFile -Value "   Description: $_"
                                            $Script:Errors = $Script:Errors + 1
                                            Continue
                                        $Step = "25"
                                        # Make the attribute value "not set".
                                        $User.PutEx(1, $AttrName, 0)
                                        $Changed = $True
                            Else
                                $Step = "26"
                                # Check if new value from spreadsheet different.
                                If ($Value -ne $OldValue)
                                    Trap
                                        Write-Host ""
                                        "Error assigning value from Active Directory: $_"
                                        Add-Content -Path $LogFile -Value "## Error assigning $AttrName for user $DN"
                                        Add-Content -Path $LogFile -Value "   Description: $_"
                                        $Script:Errors = $Script:Errors + 1
                                        Continue
                                    # Assign the new value to the attribute.
                                    $User.Put($AttrName, $Value)
                                    $Changed = $True
                        Else
                            # Unexpected error.
                            Add-Content -Path $LogFile -Value `
                                "## Unexpected syntax: $Syntax for attribute $AttrName for user $DN"
                            $Script:Errors = $Script:Errors + 1
            If ($Changed -eq $True)
                Trap
                    Write-Host ""
                    "Error saving to Active Directory: $_"
                    Add-Content -Path $LogFile -Value "## Error saving to AD for user $DN"
                    Add-Content -Path $LogFile -Value "   Description: $_"
                    $Script:Errors = $Script:Errors + 1
                    $Script:Updated = $Script:Updated - 1
                    Continue
                $User.SetInfo()
                Add-Content -Path $LogFile -Value "Update user: $DN"
                Write-Host "." -NoNewLine
                $Script:Updated = $Script:Updated + 1
            Else
                Add-Content -Path $LogFile -Value "User unchanged: $DN"
                Write-Host "." -NoNewLine
                $Script:Unchanged = $Script:Unchanged + 1
        Else
            Add-Content -Path $LogFile -Value "## User not found: $Value"
            Write-Host "." -NoNewLine
            $Script:Errors = $Script:Errors + 1
        $j = $J + 1
    } Until ($Sheet.Cells.Item($j, $ID).Text -eq "")
    $Step = "27"
    CleanUp
    Add-Content -Path $LogFile -Value $("Finished: " + (Get-Date).ToString())
    Add-Content -Path $LogFile -Value "Number of users updated: $Script:Updated"
    Add-Content -Path $LogFile -Value "Number of users unchanged: $Script:Unchanged"
    Add-Content -Path $LogFile -Value "Number of errors: $Script:Errors"
    Write-Host ""
    "Done"
    "Number of errors: $Script:Errors"
    "See log file: $LogFile"

    Actually scripts run fine with excel file, currently we are using user-id to pick to update AD. Now we want to update AD use employee id. You can say to identify the record in AD through employee ID instead of user-id. 
    I do not think you will get anyone here to fix that for you.  You need to find someone who knows PowerShell to help you or learn PowerShell your self.
    I would fix it for you but not for free.  It is too oddly designed and has too many dependencies.  Any small change is likely to break it.
    ¯\_(ツ)_/¯

  • How to lookup a value in a 2D array from an Excel file - Dasylab version 12 Pro

    Hi, I am new to this forum and am looking for some advice on a worksheet I'm trying to construct.  I have an Excel spreadsheet that is basically a 2D array, and I want to use Dasylab v12 Pro to be able to import a value from this array based on user selections from within the Dasylab worksheet.
    Column A lists 200+ diesel engine models.  I've shown 9 in my Excel attachment...one model per row (shaded in yellow), and each engine model can be run at several speeds (shaded green in columns B thru F).  For an engine in a given row, combined with a chosen operating speed gives you a corresponding horsepower (blue shading).
    I have this Excel sheet saved somewhere on my C:/ drive, and what I want to do is when the user starts the Dasylab worksheet he will select from a drop drown menu to choose the engine model (ie A, B, C, etc) and another drop down menu to choose the speed (ie 1470, 1760, etc).  I know that I can make a drop down menu with a Coded Switch within Dasylab, however it seems only 16 choices can be made from each switch, so for my 200 engine models I will need 13 switches!  I know I can assign a text description like "Engine A" to a numerical value within that coded switch.  Somehow I need to take those two selections made within the Dasylab experiment, and read this Excel file (ie my database of all of these 200 diesel engine models) as a 2 dimensional array by row and column to spit out the data value (the blue numbers) back into Dasylab.
    The goal is to take the engine model, speed, and the horsepower obtained from the array search and write these to an .asc file that I will create a running log of this data.  So, after the test page is run 50 times it will have 50 rows of data containing these 3 parameters.  There is some other test data taken from my data acquisition that goes along with this, however that's not part of my 2D array predicament.
    I'm taking a guess that I need to do something with global strings & variables, and some how import them and export them with an ODBC in/out module.  This is something I've just never worked with before so I am a bit lost.  Obviously I can just make the user type in the engine model and speed as a startup parameter at the start of the test and save that to a variable or string, but I want to make it idiot proof so that the two selections (ie row and column) can be chosen from a pre-set list and will yield my data value.  Everything else related to Dasylab I am pretty proficient with.
    Thanks,
    Mike
    Attachments:
    engine 2D array.xlsx ‏10 KB

    This would be the best way.
    Also, with version 13 they started using Phyton to create custom modules that can be programmed in DASYLab.
    We arte learning this right now and I know that you can use standard message dialogs with that as well.
    I would suggest to you to download a demo of V13 and take a look at the Pyton module.
    Also, usually DASYLab system intgretors like us, can provide services also on things like this including Excel programming for pre and post analisys 
    Tom Rizzo
    InSyS Corp.
    www.insyscorp.com
    Your DASYLab integrator

  • Intermittent Error 41106 Error when trying to open an Excel file.

    I am having an intermittent problem while opening an Excel file.  The problem only occurs occasionally during execution of my program.  My program has a cluster of buttons each button opens a sub VI that is part of a calibration process.  The first VI generates an EXCEL filename that is used to save all calibration data.  A template is opened, data is placed in this template, and then it is saved under the generated filename.  Most of the time this seems to work fine, but every once in a while I receive a -41106 error indicating that Microsoft EXCEL did not open.  As far as I can tell when I run each sub VI independently they work fine and no errors are generated.  Does anyone know why this might be happening?  I would appreciate any help.
    Thanks 

    What version of LabVIEW and the Report Generation Toolkit are you using?  I remember adding some code in the 1.1 version of the toolkit to attempt to avoid some Microsoft Excel latencies with opening/closing the application repeatedly, but it was by no means fool proof, since Excel sometimes takes its sweet time leaving memory when the application exits.  Without knowing any more specifics, my best suggestion is for you to add a small delay between successive operations regarding opening/closing Excel and see if that helps.  Also, if you could post a simple VI that demonstrates the behavior, that would be extra helpful.
    Oh yeah, and another suggestion would be to open one report reference at the beginning of your program, and use this reference through the whole thing...I understand that this might not be possible, though, if you're opening different worksheets throughout the course of your application running.
    Good luck,
    -D
    P.S. - For those of you reading this wondering why I would automatically assume MegaMan is using the Report Generation Toolkit, he cites error -41106, which is an error specific to this toolkit.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • I want to create a document/spreadsheet (whichever) that I can send to agencies to type in information for work projects. Any ideas? I have an Excel file but it does not convert over very well and I am having trouble making changes to it.

    Need to create a new spreadsheet or be able to edit the one I have.
    I use this spreadsheet as a work order form for social service agencies. They enter name address etc., and then there are various work projects that they can select as well.
    The one I have from the organization I work with is an excel file but it does not convert over very well. Instead of being 7 pages it is more like 11 or so because things run off the page.  I am trying to delete certain things and move them over but not working out very well so thought it might be easier to start over fresh.
    Is numbers the program to use? If so, any useful tips?

    If the form is going to be used on an iPad, Numbers is the only game in town.
    Numbers is available for Macs only (and iOS devices). Excel is available for PCs and Macs. If you are in a mixed environment of Windows PCs and Macs and you are using this document as an electronic form, Excel is probably the better choice. Otherwise you will need to export to Excel for the PC users then import from Excel to retrieve their data. The import/export process is not perfect. A file that has been exported then reimported will not be the same as the original file. I would assume social services agencies are almost entirely PC-based. 
    If the form is to be printed or turned into a PDF for distribution and use by the social services agencies, either Excel or Numbers would do the job but right now Excel might be the better choice. I would have recommended Numbers '09 but I cannot recommend Numbers 3 for anything thsat requires printing until they give us the layout and printing functionality we used to have (editing in Print View, ability to set margins, etc).
    If everything else in your department/operation/agency is Windows PC and Microsoft Office based, you would be better off sticking with the standard.
    I hope that helps.

  • How do I merge multiple Excel files with more than one tab in each file using PowerQuery?

    Hello
    I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them. 
    I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
    Cheers
    James

    What Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
    When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
    You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
    icon in the header and you'll be done.
    Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
    two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
    let
        Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
        RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
        PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
        ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
    in
        ExpandData

  • How to sync two excel files, the content is the same in both files after edit.

    I have two excel files, which are data and edit by multi users, how can I sync the master files to the copy files after edit?
    Is this operation required VBA? marco?

    Hi,
    Your request could be done via VBA code. Here are two ideas.
    One:
    Syncing the data from master file to the copy file without opening copy file. Sample code
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    Dim cnn As Object, SQL$, s$
    Select Case True
    Case Target.Value = ""
    s = "null"
    Case IsDate(Target.Value)
    s = "#" & Target.Value & "#"
    Case IsNumeric(Target.Value)
    s = Target.Value
    Case Else
    s = "'" & Target.Value & "'"
    End Select
    Set cnn = CreateObject("ADODB.Connection")
    cnn.Open "provider=microsoft.jet.oledb.4.0;extended properties='excel 8.0;hdr=no';data source=" & ThisWorkbook.Path & "\test folder\Book2.xls"
    SQL = "update [Sheet1$" & Target.Address(0, 0) & ":" & Target.Address(0, 0) & "] set f1=" & s
    cnn.Execute (SQL)
    cnn.Close
    Set cnn = Nothing
    End Sub
    Two:
    Saving the master file as copy file before closing. Reference:
    https://msdn.microsoft.com/en-us/library/office/ff194765.aspx?f=255&MSPPError=-2147217396
    If you have any further question about coding, I recommend you post the question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected].

  • Automatically create new Excel file from template using data from a selected row in a separate Excel file

    I am fairly new to Macro and VBA in Excel. I am trying to reduce the amount of work involved in a task that is performed often in our office. Currently, the task involves using 2 separate Excel files. One file is a tracking sheet and the second is the document
    that gets sent out to the client. The second document has all the same information that is inserted into the tracking sheet. What I would like to do is have the information that is in one row on the tracking sheet populate into a new excel file that is created
    automatically from an existing template.
    I have been able to make this partially work. What I have been able to achieve is have the cell that is selected in the tracking sheet (the description field) copy into the new file that is created from the template that is on our server.
    Sub NewRFI()
    ' NewRFI Macro
        MsgBox Selection.Address(ReferenceStyle:=xlA1, _
                               RowAbsolute:=False, ColumnAbsolute:=False)
        Selection.Copy
        Workbooks.Add Template:= _
            "template file path goes here"
        Range("C14").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
        Range("C14").Select
        Application.CutCopyMode = False
    End Sub
    What I need to do is get the rest of the information from that same row in the tracking sheet to copy to the new file as well. The other information includes the document number (one cell to the left of the selected cell), who it is from (one cell to the
    right of the selected cell), and the date (two cells to the right of the selected cell). As stated, this information is all in the same row on the tracking sheet. Each piece of information needs to be copied to a certain cell in the new file and I do not want
    the source formatting to be copied to the new file.
    Ideally, I would like it to operate like so: select the first cell in the row (in this case would be the document number field). Then click a button to run the macro that will then copy the information from that row in the tracking sheet to specific cells
    in the new file that is created from the template.
    This process will save us from having to either manually copy and paste the information into the new file or re-type the same information that is already in the tracking sheet.
    This is probably a simple thing to do but it would be great if anybody had some insight on this issue. Thanks in advance!

    Try code like the following. You will have to change the target cells (D25, F1 and H4) to the ones you want, I just used some arbitrary cells as example.
    Sub NewRFI()
    Dim rngCell As Range
    Set rngCell = ActiveCell
    MsgBox Selection.Address(ReferenceStyle:=xlA1, _
    RowAbsolute:=False, ColumnAbsolute:=False)
    Workbooks.Add Template:="template file path goes here"
    Range("C14").Value = rngCell.Value
    ' Change the target cells as needed
    Range("D25").Value = rngCell.Offset(0, -1).Value
    Range("F1").Value = rngCell.Offset(0, 1).Value
    Range("H4").Value = rngCell.Offset(0, 2).Value
    End Sub
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • OPM Error while opening excel files

    When I open the excel file of my rule, it gives the following error.
    Oracle Policy Modeling
    An error occurred while opening the document 'C:\Documents and Settings\HCHATURV\Desktop\Customer Service\OPA\Development\Rules\Raise.xls': Unable to set the Installed property of the AddIn class
    OK
    I uninstalled OPA from my machine and again installed it but no result.
    I would be thankful If somebody can help.

    What version of OPA/OPM is this? What operating system & processor type (32 or 64 bit)? What version of Excel?
    Depending on what was active when installing or uninstalling, Excel may not be looking at the correct location of the OPM add-in. The one time I've seen this was with XP and Office 2007 (both 32 bit) which was solved by the following:
    1) Open the excel document outside OPM
    2) Select "Excel Options" from the Office Menu (circle at top left). Select "Add-Ins", then find "Manage: Excel Add-Ins", and click "Go...".
    3) Tick Oracle Policy Modeling Excel 2007 (if it is already ticked, try un-ticking, pressing okay, and ticking it again)
    4) Press OK
    5) Try opening the workbook again in OPM.
    I think if you can convince Excel that the add-ins isn't active any more, then OPM will be able to convince Excel to use the correct location.

  • Excel file save error: Someone else is working in file right now. Please try again later.

    When trying to save a modified Excel file, which has been opened from a network share, our users are receiving the following message:
    Someone else is working in "\\domain.com\users\username\Document.xls" right now. Please try again later.
    The clients that have been affected are Windows 7 clients, and the DFS share is being served from a Windows 2012 server. I have already confirmed that DFS replication has not been enabled, so it isn't trying to lock files for replication. I have also disabled
    any real-time scanning that is occurring on the client to make sure that the AV software wasn't locking the files. I did notice when viewing the list of Open Files from the server's Computer Management console that when a users experiences this issue the file
    appears to be opened 4 times. Three times it shows that it was opened in Read mode and the 4th instance shows an Open Mode of Write. Typically, a file which is working correctly should just show one instance with the Open Mode of Read+Write. None of these
    open instances are temporary files preceded with a ~.
    Any thoughts?

    Hi,
    Does the issue occur in other operation system? Which Office version are you using? Have you ever tried to test with word document, PPT file or txt file?
    Based on your description, the issue may be caused by the same file open multiple time in computer management on SQL server. The user probably has User Access Control (UAC) enabled on the machine and it is not letting him overwrite the existing
    copy of the file because she does not have it open in administrator mode. UAC will block overwriting (saving) the existing file without Administrative privileges and it will automatically open the save as dialog so you can save with a different name and
    if you click save without changing the name at the point, it tries to save as a new file over the existing file and it can't because the file is open.
    I recommend you check the user's permission (Which showed in Computer Management console) and end the Excel file instance in the task manager of the user's client.
    Also, we may try the workaround: Save it to local drive(like drive c:) and then copy it to DFS.
    Thanks
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

Maybe you are looking for