Search Results

Search found 175 results on 7 pages for 'workbooks'.

Page 1/7 | 1 2 3 4 5 6 7  | Next Page >

  • Excel 2007: Named ranges problems when linking workbooks

    - by Mike
    I've 30+ workbooks each with 5 specific worksheets (formated the same). Each worksheet's data needs to be linked to a master workbook, so that I end up with 5 master workbooks and all the specific data in one long table format $A$2:$I$750. (Are you still with me? ;)) I don't have access to a database, so I'm having to link the sheets to their master workbook directly. I've highlighted the data I need; named the range; and then tried referencing this from my master workbook. I get the #Value error symbol when I try to link (=[WorkbookName]!MyNamedRange) to a cell that doesn't match the top left cell of my range. Example: MyNamedrange is always =$A$2:$I43$ on one specific sheet. On my master workbook it works if it's referenced at A2 but I get #Value if it's referenced A1, or A44. Any ideas? I'm trying to link my data in one continous table so I can run a pivot on it, and other things. Can it be done like this, or should I just copy and paste? I'm trying to keep things 'linked'so I do not need to spend time C&Ping all day. Many thanks Mike.

    Read the article

  • Excael 2007: Name range problems when linking workbooks

    - by Mike
    I've 30+ workbooks each with 5 specific worksheets (formated the same). Each worksheet's data needs to be linked to a master workbook, so that I end up with 5 master workbooks and all the specific data in one long table format $A$2:$I$750. (Are you still with me? ;)) I don't have access to a database, so I'm having to link the sheets to their master workbook directly. I've highlighted the data I need; named the range; and then tried referencing this from my master workbook. I get the #Value error symbol when I try to link (=[WorkbookName]!MyNamedRange) to a cell that doesn't match the top left cell of my range. Example: MyNamedrange is always =$A$2:$I43$ on one specific sheet. On my master workbook it works if it's referenced at A2 but I get #Value if it's referenced A1, or A44. Any ideas? I'm trying to link my data in one continous table so I can run a pivot on it, and other things. Can it be done like this, or should I just copy and paste? I'm trying to keep things 'linked'so I do not need to spend time C&Ping all day. Many thanks Mike.

    Read the article

  • Hide and Unhide Worksheets and Workbooks in Excel 2007 & 2010

    - by DigitalGeekery
    Hiding worksheets can be a simple way to protect data in Excel, or just a way reduce the clutter of a some tabs. Here are a couple very easy ways to hide and unhide worksheets and workbooks in Excel 2007 / 2010. Hiding a Worksheet Select the Worksheet you’d like to hide by clicking on the tab at the bottom. By holding down the Ctrl key while clicking you can select multiple tabs at one time. On the Home tab, click on Format, which can be found in the Cells group. Under Visibility,  select Hide & Unhide, then Hide Sheet.   You can also simply right-click on the tab, and select Hide.   Your worksheet will no longer be visible, however, the data contained in the worksheet can still be referenced on other worksheets.   Unhide a Worksheet To unhide a worksheet, you just do the opposite. On the Home tab, click on Format in the Cells group and then under Visibility,  select Hide & Unhide, then Unhide Sheet.   Or, you can right-click on any visible tab, and select Unhide.   In the Unhide pop up window, select the worksheet to unhide and click “OK.” Note: Although you can hide multiple sheets at once, you can only unhide one sheet at a time. Very Hidden Mode While hidden mode is nice, it’s not exactly ultra-secure. If you’d like to pump the security up a notch, there is also Very Hidden mode. To access Very Hidden setting, we’ll have to use the built-in Visual Basic Editor by hitting the Alt + F11 keys. Select the worksheet you wish to hide from the dropdown list under Properties or by single clicking the worksheet in the VBAProject window. Next, set the Visible property to  2 – xlSheetVeryHidden. Close out of the Visual Basic Editor when finished.   When the Very Hidden attribute is set on a worksheet, Unhide Sheet is still unavailable from within the Format setting on the Home tab.   To remove the Very Hidden attribute and display the worksheet again, go back into the Visual Basic Editor by hitting Alt + F11 again and setting the Visible property back to –1 – xlSheetVisible.  Close out of the Editor when finished. Hiding a Workbook To hide the entire Workbook, select the View tab, and then click the Hide button. You’ll see the Workbook has disappeared. Unhide a Workbook Select the View tab and click Unhide… … and your Workbook will be visible again.   Just a few simple ways to hide and unhide your Excel worksheets and workbooks. Similar Articles Productive Geek Tips How To Copy Worksheets in Excel 2007 & 2010Add Background Pictures To Excel 2007 WorksheetsMake Row Labels In Excel 2007 Freeze For Easier ReadingImport Microsoft Access Data Into ExcelMagnify Selected Cells In Excel 2007 TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Discover Latest Android Apps On AppBrain The Ultimate Guide For YouTube Lovers Will it Blend? iPad Edition Penolo Lets You Share Sketches On Twitter Visit Woolyss.com for Old School Games, Music and Videos Add a Custom Title in IE using Spybot or Spyware Blaster

    Read the article

  • Excel - working with multiple workbooks

    - by cKK
    Got about 50 workbooks that cannot be merged but need to make the data available in a nice easy way. Aany ideas how to open and close multiple workbook modally i.e control remains in some interface / menu window? all workbooks have multiple sheets and need to be opened read-only. thanks

    Read the article

  • Merge Mutliple Excel Workbooks

    - by IRHM
    I wonder whether someone may be able to help me please. I'm trying to use the code below to allow the user to select multiple Excel Workbooks, amalgamating the data into one 'Summary' sheet. Sub Merge() Dim DestWB As Workbook, WB As Workbook, WS As Worksheet, SourceSheet As String Set DestWB = ActiveWorkbook SourceSheet = "Input" startrow = 7 FileNames = Application.GetOpenFilename( _ filefilter:="Excel Files (*.xls*),*.xls*", _ Title:="Select the workbooks to merge.", MultiSelect:=True) If IsArray(FileNames) = False Then If FileNames = False Then Exit Sub End If End If For n = LBound(FileNames) To UBound(FileNames) Set WB = Workbooks.Open(Filename:=FileNames(n), ReadOnly:=True) For Each WS In WB.Worksheets If WS.Name = SourceSheet Then With WS If .UsedRange.Cells.Count > 1 Then dr = DestWB.Worksheets("Input").Range("C" & Rows.Count).End(xlUp).Row + 1 lastrow = .Range("C" & Rows.Count).End(xlUp).Row For j = lastrow To startrow Step -1 Select Case .Range("E" & j).Value Case "Manager", "Lead", "Technical", "Analyst" 'do nothing Case Else .Rows(j).EntireRow.Delete End Select Next lastrow = .Range("C" & Rows.Count).End(xlUp).Row If lastrow >= startrow Then .Range("B" & startrow & ":AD" & lastrow).Copy DestWB.Worksheets("Input").Cells(dr, "B").PasteSpecial xlValues .Range("AF" & startrow & ":AQ" & lastrow).Copy DestWB.Worksheets("Input").Cells(dr, "AF").PasteSpecial xlValues .Range("AS" & startrow & ":AS" & lastrow).Copy DestWB.Worksheets("Input").Cells(dr, "AS").PasteSpecial xlValues End If End If End With Exit For End If Next WS WB.Close savechanges:=False Next n End Sub The code works fine except for one issue which I've been trying to solve for the last few weeks. The following line of code looks in column E of the Source file, and if any of the entries match the values shown in the code it copies that row of data to paste into the Destination file. If Range("E" & j) <> "Manager" And Range("E" & j) <> "Lead" And Range("E" & j) <> "Technical" And Range("E" & j) <> "Analyst" Then Rows(j).Delete The problem I have is that if none of these values are found in the Source file, I receive the following error: Run time error '1004': Delete method of range class failed and in Debug mode it highlights this part of the line as the source of the error, but I've no idea why. Rows(j).Delete I just wondered whether someone may be able to look at this please and let me know where I'm going wrong, or perhaps even suggest a more efficient process of allowing the user to merge the workbooks. Many thanks and kind regards

    Read the article

  • Merge Multple Worksheets From Multple Workbooks

    - by Droter
    Hi, I have found multiple posts on merging data but I am still running into some problems. I have multiple files with multiple sheets. Example 2007-01.xls...2007-12.xls in each of these files are daily data on sheets labeled 01, 02, 03 ..... There are other sheets in the file so I can't just loop through all worksheets. I need to combine the daily data into monthly data, then all of the monthly data points into yearly. On the monthly data I need it to be added to the bottom of the page. I have added the file open changes for Excel 2007 Here is what I have so far: Sub RunCodeOnAllXLSFiles() Dim lCount As Long Dim wbResults As Workbook Dim wbMaster As Workbook Application. ScreenUpdating = False Application.DisplayAlerts = False Application.EnableEvents = False On Error Resume Next Set wbMaster = ThisWorkbook Dim oWbk As Workbook Dim sFil As String Dim sPath As String sPath = "C:\Users\test\" 'location of files ChDir sPath sFil = Dir("*.xls") 'change or add formats Do While sFil <> "" 'will start LOOP until all files in folder sPath have been looped through Set oWbk = Workbooks.Open(sPath & "\" & sFil) 'opens the file Set oWbk = Workbooks.Open(sPath & "\" & sFil) Sheets("01").Select ' HARD CODED FIRST DAY Range("B6:F101").Select 'AREA I NEED TO COPY Range("B6:F101").Copy wbMaster.Activate Workbooks("wbMaster").ActiveSheet.Range("B65536").End(xlUp)(2).PasteSpecial Paste:=xlValues Application.CutCopyMode = False oWbk.Close True 'close the workbook, saving changes sFil = Dir Loop ' End of LOOP On Error Goto 0 Application.ScreenUpdating = True Application.DisplayAlerts = True Application.EnableEvents = True End Sub Right now it can find the files and open them up and get to the right worksheet but when it tries to copy the data nothing is copied over. Thanks for your help, Matt

    Read the article

  • Macro - To create one [.csv] file from/using multiple workbooks, kept in a folder, containing multi

    - by AJ
    Hello, I have more than one Excel Workbooks containing multiple worksheets in each of them. I would like to have a macro which help me to create (combine the information from) all the worksheets into one pipe [|] delimited [.csv] file. These sheets should be combined/appended into the [.csv] file, in the same order these worksbooks appear in a folder and in the order sheets appear in these workbooks. The macro should ask for a delimiter/separator specific to me and the input and output path based on my selection. It would be great if the output [.csv] file is names as "foldername" + "Output.csv" Thank you, Best Regards - AJ

    Read the article

  • How to delete specific columns from all excel workbooks in a particular folder

    - by Firee
    I have a folder in which I have about 30 excel files. In each of these files, I need to delete about 20 specific columns. Here are some details: I am using Excel 2013 The columns are in the first sheet of the excel file. each file can have several sheets, but the columns that need to be deleted are in the first sheet. Here are the names of the columns but please note, the columns are sometimes repeated: Heather National Light General Louisa Terruin Would love some help.

    Read the article

  • Excel workbooks produced by POI don't work when linked

    - by Eric Nicolas
    Here is what I'm doing : Create a workbook in memory (book = new HSSFWorkbook(), ...) Save it to disk (book.write(...)) Open in Excel (ok) Create another workbook in Excel, which links to the first one (=PoiWorkbook?xls!A1) Close Excel Then everytime I open the second workbook again, all the links are #N/A, unless I also open the POI-generated workbook at the same time. I never saw this behaviour with standard workbooks created in Excel. Anyone has seen this and found a workaround ? Thanks.

    Read the article

  • Runtime Error 1004 using Select with several workbooks

    - by Johaen
    I have an Excel workbook which pulls out data from two other workbooks. Since the data changes hourly there is the possibility that this macro is used more than one time a day for the same data. So I just want to select all previous data to this date period and want to delete them. Later on the data will be copied in anyway. But as soon as I want to use WBSH.Range(Cells(j, "A"), Cells(lastRow - 1, "M")).Select the code stopes with Error 1004 Application-defined or object-defined error. Followed just a snippet of the code with the relevant part. What is wrong here? 'Set source workbook Dim currentWb As Workbook Set currentWb = ThisWorkbook Set WBSH = currentWb.Sheets("Tracking") 'Query which data from the tracking files shoud get pulled out to the file CheckDate = Application.InputBox(("From which date you want to get data?" & vbCrLf & "Format: yyyy/mm/dd "), "Tracking data", Format(Date - 1, "yyyy/mm/dd")) 'states the last entry which is done ; know where to start ; currentWb File With currentWb.Sheets("Tracking") lastRow = .Range("D" & .Rows.Count).End(xlUp).Row lastRow = lastRow + 1 End With 'just last 250 entries get checked since not so many entries are made in one week j = lastRow - 250 'Check if there is already data to the look up date in the analyses sheet and if so deletes these records Do j = j + 1 'Exit Sub if there is no data to compare to prevent overflow If WBSH.Cells(j + 1, "C").Value = "" Then Exit Do End If Loop While WBSH.Cells(j, "C").Value < CheckDate If j <> lastRow - 1 Then 'WBSH.Range(Cells(j, "A"), Cells(lastRow - 1, "M")).Select 'Selection.ClearContents End If Thank you!

    Read the article

  • Manipulate Excel workbooks programmatically

    - by Tom
    I have an Excel workbook that I want to use as a template. It has several worksheets setup, one that produces the pretty graphs and summarizes the numbers. Sheet 1 needs to be populated with data that is generated by another program. The data comes in a tab delimited file. Currently the user imports the tab delimited file into a new Workbook, selects all and copies. Then goes to the template and pastes the data into sheet1. This is a large amount of data, 269 columns and over 135,000 rows. It’s a cumbersome process and the users are not experienced Excel users. All they really want is the pretty graphs. I would like to add a step after the program that generates the data to programmatically automate the process the user currently must do manually. Can anyone suggest the best method/programming language that could accomplish this?

    Read the article

  • Importing data from many excel workbooks and sheets into a single workbook/table

    - by Max Rusalen
    Hi, I have 54 excel files with three sheets each, each sheet has a different amount of data entries but they are set out in a identical format, and I need to import the data from those sheets into a single workbook using VBA. Is there any way I can program it so I can build the loops to import the data, but without having to write in each workbook name for each loop/sheet? I think I can use the call function, but I don't know how to make the loop codes independent of the workbook name they apply to. Thank you so much in advance, Millie

    Read the article

  • How can I fix a date that changes by 4 years and 1 day when pasted between Excel workbooks

    - by lcbrevard
    In Excel dates are represented internally by a floating point number where the integer part is the number of days since "some date" and the fractional part is how far into that day (hence the time). You can see this if you change the format of a date - like 4/10/2009 to a number 39905. But when pasting a date between two different workbooks the date shifts by 4 years and one day!!! In other words "some date" is different between the two workbooks. In one workbook the number 0.0 represents 1/0/1900 and in the other 0.0 represents 1/1/1904. Where is this set and is it controllable? Or does this represent a corrupted file? These workbooks where originally from Excel 2000 but have been worked on now in Excel 2007 and Excel 2003. I can demonstrate the problem between the two workbook files in both 2003 and 2010. The exact history of when they were created or what versions of Excel have been used on each is unknown.

    Read the article

  • Excel COM - Unable to get the Open property of the Workbooks class?

    - by Abs
    Hello all, I have tried this and I get this error: $excel_app = new COM("Excel.Application") or Die ("Did not connect"); $Workbook = $excel_app->Workbooks->Open('Variables.xls') or Die('Did not open filename'); I get this error: Unable to get the Open property of the Workbooks class What does this error mean? In addition, is there an API or a function list for accessing excel via COM. Thanks all Update Full error: exception 'com_exception' with message 'Source: Microsoft Excel Description: Unable to get the Open property of the Workbooks class' in C:\excel.php:22 Stack trace: #0 C:\excel.php(22): variant->Open('C:\...') #1 {main}

    Read the article

  • Properly clean up excel interop objects revisited: Wrapper objects

    - by chiccodoro
    Hi all, Excel 2007 Hangs When Closing via .NET How to properly clean up Excel interop objects in C# How to properly clean up interop objects in C# All of these struggle with the problem that C# does not release the Excel COM objects properly after using them. There are mainly two directions of working around this issue: Kill the Excel process when Excel is not used anymore. Take care to assign each COM object used explicitly to a variable and to Marshal.ReleaseComObject all of these. Some have stated that 2 is too tedious and there is always some uncertainty whether you forget to stick to this rule at some places in the code. Still 1 seems dirty and dangerous to me, also I could imagine that in an environment with restricted access killing processes is not allowed. So I've been thinking about solving 2 by creating another proxy object model which mimics the Excel object model (for me, it would suffice to implement the objects I actually need). The principle would look as follows: Each Excel Interop class has its proxy which wraps an object of that class. The proxy releases the COM object in its destructor. The proxy mimics the interface of the Interop class (maybe by inheriting it). Any methods that usually return another COM object return a proxy instead. The other methods simply delegate the implementation to the inner COM object. This is a rough sketch of the code: public class Application : Microsoft.Office.Interop.Excel.Application { private Microsoft.Office.Interop.Excel.Application innerApplication = new Microsoft.Office.Interop.Excel.Application innerApplication(); ~Application() { Marshal.ReleaseCOMObject(innerApplication); } public Workbooks Workbooks { get { return new Workbooks(innerApplication.Workbooks); } } } public class Workbooks { private Microsoft.Office.Interop.Excel.Workbooks innerWorkbooks; Workbooks(Microsoft.Office.Interop.Excel.Workbooks innerWorkbooks) { this.innerWorkbooks = innerWorkbooks; } ~Workbooks() { Marshal.ReleaseCOMObject(innerWorkbooks); } } My questions to you are in particular: Who finds this a bad idea and why? Who finds this a gread idea? If so, why hasn't anybody implemented/published such a model yet? Just due to the effort, or am I missing a killing problem with that idea? Is it impossible/bad/dangerous to do the ReleaseCOMObject in the destructor? (I've only seen proposals to put it in a Dispose() rather than in a destructor - why?) If the approach makes sense, any suggestions to improve it?

    Read the article

  • In Open Calc, how do I copy a paste cells that contain references to other workbooks?

    - by Gabriel
    I have an OpenOffice Calc sheet with cells containing formulas that refer to another file, e.g: 'file:///C:/path/to/other.xls'#$Sheet1.A1:B2. Note: When I copy the cells from one sheet to another in the same workbookt, it works as expected. When I copy this to a sheet in another workbook, the references are lost and all is left is ''#$Sheet1.A1:B2. I could copy/paste the cell's contents, but that would be fastidious, error-prone, and anyhow not a good solution. How do I keep the external references when copy-pasting from one workbook to another ?

    Read the article

  • Free libraries to work with Excel

    - by Danil Gholtsman
    I got some excel files, I need to read data from it and upload data to some database (I need to use firebird, but whatever). Right now I use <QAxObject> from Qt and code look like QAxObject* excel = new QAxObject("Excel.Application"); //pointer to excel //excel->setProperty("Visible", false); QAxObject* workbooks = excel->querySubObject("WorkBooks"); //get pointer to booklist workbooks->dynamicCall("Open (const QString&)", QString("C:\\databases\\test.xls")); //opening file, getting pointer to booklist QAxObject* workbook = excel->querySubObject("ActiveWorkBook"); QAxObject* worksheets = workbook->querySubObject("WorkSheets"); etc. The problem is that this way on users PC there must be installed Excel. Is there exists some free C++ libraries to work with *.xls, *.xlsx files without Excel installed?

    Read the article

  • JDeveloper 11g R1 (11.1.1.4.0) - New Features on ADF Desktop Integration Explained

    - by juan.ruiz
    One of the areas that introduced many new features on the latest release (11.1.1.4.0)  of JDeveloper 11g R1 is ADF Desktop integration - in this article I’ll provide an overview of these new features. New ADF Desktop Integration Ribbon in Excel - After installing the ADF desktop integration add-in and depending on the mode in which you open the desktop integration workbook, the ADF Desktop integration ribbon for design time and runtime are displayed as a separate tab within Excel. In previous version the ADF Desktop integration environment used to be placed inside the add-ins tab. Above you can see both, design time ribbon as well as runtime ribbon. On the design time ribbon you can manage the workbook and worksheet properties, worksheet component properties, diagnostics, execution and publication of the workbook. The runtime version of the ribbon is totally customizable and represents what it used to be the runtime menu on the spreadsheet, in this ribbon you can include all the operations and actions that could be executed by the end user while working with the spreadsheet data. Diagnostics - A very important aspect for developers is how to debug or verify the interactions of the client with the server, for that ADF desktop integration has provided since day one a series of diagnostics tools. In this release the diagnostics tools are more visible and are really easy to configure. You can access the client console while testing the workbook, or you can simple dump all the messages to a log file – having the ability of setting the output level for both. Security - There are a number of enhancements on security but the one with more impact for developers is tha security now is optional when using ADF Desktop Integration. Until this version every time that you wanted to work with ADFdi it was a must that the application was previously secured. In this release security is optional which means that if you have previously defined security on your application, then you must secure the ADFdi servlet as explained in one of my previous (ADD LINK) posts. In the other hand, if but the time that you start working with ADFdi you have not defined security, you can test and publish your workbooks without adding security. Support for Continuous Integration - In this release we have added tooling for continuous integration building. in the ADF desktop integration space, the concept translates to adding functionality that developers can use to publish ADFdi workbooks as part of their entire application build. For that purpose, we have a publish tool that can be easily invoke from an ANT task such that all the design time workbooks are re-published into the latest version of the application building process. Key Column - At runtime, on any worksheet containing editable tables you will notice a new additional column called the key column. The purpose of this column is to make the end user aware that all rows on the table need to be selected at the time of sorting. The users cannot alter the value of this column. From the developers points of view there are no steps required in order to have the key column included into the worksheets. Installation and Creation of New Workbooks - Both use cases can be executed now directly from JDeveloper. As part of the Tools menu options the developer can install the ADF desktop integration designer. Also, creating new workbooks that previously was done through that convert tool shipped with JDeveloper is now automatic done from the New Gallery. Creating a new ADFdi workbook adds metadata information information to the Excel workbook so you can work in design time. Other Enhancements Support for Excel 2010 and the ADF components ready-only enabled don’t allow to change its value – the cell in Excel is automatically protected, this could cause confusion among customers of previous releases.

    Read the article

  • How do you place an Excel Sheet/Workbook onto a C# .NET Winform?

    - by incognick
    I am trying to create a stand alone application in Visual Studio 2008 C# .Net that will house Excel Workbooks (2007). I am using Office.Interop in order to create the Excel application and I open the workbooks via Workbooks.Open(...). The Interop does not provide any functionality to "move" the workbooks onto a form so I turned to P/Invoke Win32 library. I am able to move the entire excel application onto a WinForm with great success: // pseudo code to give you the idea excel = new Excel.ApplicationClass(); SetParent(excel.Hwnd, form.handle); This allows me to customize the form and control user input. All right click commands and formula editing work properly. Now, the issue I run into is when I want to open two workbooks in two separate forms. I do this by creating two excel application classes and placing each of those in their own form. When I try to reference one workbook to another workbook via =[Book2]Sheet1!A1, for example, it does not update. This is expected as each application is running under its own thread/process. Here are the alternatives I have tried. If you have any suggestions I would be greatly appreciative.(OLE is not an option. VSTO must be available) Create a single application class and move the workbook window into my form. Results: The window moves into my form and displays correctly, however, no right click or left click works on the form and it never gains focus. (I have tried to manually set focus and it does not work either). My guess is, by moving the window outside of the XLDESK application (viewable in Spy++ for Excel Application), the workbook application (EXCEL7) does not receive the correct window messages to gain focus and to behave properly. This leads me to: Move the XLDESK window handle into my form. Results: This allows the workbook to be click-able again but also has an undesired result of moving all child windows into the same form. Create a main excel application that creates workbooks. Create a new excel application for each new window. Move the workbook under the new excel application XLDESK window. Results: This also has the same effect of the 1st option. Unable to click in the workbook. This must mean that the thread that created the workbook is also responsible for the events. Create a windows hook that watches the WndProc procedure. Results: No events watched. The targeted thread must export the hook proc in a DLL export call. Excel does not do this and thus you cannot inject into it's DLL (unless someone can prove me wrong). I am able to watch all threads within my own process but not from an outside process. Excel is created as a separate process. Subclass NativeWindow. Results: Same as #4. After I move the window into my form, all events are captured up until the mouse is directly over the excel sheet making the sheet seem unclickable. One idea I haven't tried yet is just to continually save the excel sheet as the user edits it. This should update all references but I would feel this would cause poor system performance. There will be numerous chart references as well and I'm not sure if this solution would cause problems further down the road. I think in the end, all the workbooks need to be created by the same Excel Application and then moved to get the desired results but I can't seem to find the correct way to move the windows without disabling the user input in the process. Any suggestions?

    Read the article

  • Calling this[int index] via reflection

    - by tkutter
    I try to implement a reflection-based late-bound library to Microsoft Office. The properties and methods of the Offce COM objects are called the following way: Type type = Type.GetTypeFromProgID("Word.Application"); object comObject = Activator.CreateInstance(type); type.InvokeMember(<METHOD NAME>, <BINDING FLAGS>, null, comObject, new object[] { <PARAMS>}); InvokeMember is the only possible way because Type.GetMethod / GetProperty works improperly with the COM objects. Methods and properties can be called using InvokeMember but now I have to solve the following problem: Method in the office-interop wrapper: Excel.Workbooks wb = excel.Workbooks; Excel.Workbook firstWb = wb[0]; respectively foreach(Excel.Workbook w in excel.Workbooks) // doSmth. How can I call the this[int index] operator of Excel.Workbooks via reflection?

    Read the article

  • Convert Excel File 'xls' to CSV, CAUTION: Bumps Ahead

    - by faizanahmad
    The task was to provide users with an interface where they can upload the 'csv' files, these files were to be processed and loaded to Database by a Console application. The code in Console application could not handle the 'xls' files so we thought, OK, lets convert 'xls' to 'csv' in the code, Seemed like fun. The idea was to convert it right after uploading within 'csv' file. As Microsoft does not recommend using the  Excel objects in ASP.NET, we decided to use the Jet engine to open xls. (Ace driver is used for xlsx) The code was pretty straight, can be found on following links: http://www.c-sharpcorner.com/uploadfile/yuanwang200409/102242008174401pm/1.aspx http://www.devasp.net/net/articles/display/141.html FIRST BUMP 'OleDbException (0x80004005): Unspecified error' ( Impersonation ): The ablove code ran fine in my test web site and test console application, but it gave an 'OleDbException (0x80004005): Unspecified error' in main web site, turns out imperonation was set to True and as soon as I changed it to False, it did work. on My XP box, web site was running under user                   'ASPNET'  with imperosnation set to FALSE                   'IUSR_*' i.e IIS guest user with impersonation set to TRUE The weired part was that both users had same rights on the folders I was saving files to and on Excel app in DCOM Config.  We decided to give it a try on Windows Server 2003 with web site set to windows authentication ( impersonation = true ) and yes it did work. SECOND BUMP 'External table not in correct format': I got this error with some files and it appeared that the file from client has some metadata issues  ( when I opened the file in Excel and try to save it ,excel  would give me this error saying File can not be saved in current format ) and the error was caused by that. Some people were able to reslove the error by using "Extended Properties=HTML Import;" in connection string. But it did not work for me. We decided to detour from here and use Excel object :( as we had no control on client setting the meta deta of Excel files. Before third bump there were a ouple of small thingies like 'Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005' Fix can be found at http://blog.crowe.co.nz/archive/2006/03/02/589.aspx THIRD BUMP ( Could not get rid of the EXCEL process  ):  I has all the code in place to 'Quiet' the excel, but, it just did not work. work around was done to Kill the process as we knew no other application on server was using EXCEL.  The normal steps to quite the excel application worked just fine in console application though.   FOURTH BUMP: Code worked with one file 1 on my machine and with the other file 2 code will break. and the same code will work perfectly fine with file 2 on some other machine . We moved it to QA  ( Windows Server 2003 )and worked with every file just perfect. But , then there was another problem: one user can upload it and second cant, permissions on folder and DCOM Conifg checked. Another Detour: Uplooad the xls as it is and convert in Console application.   Lesson Learnt:  If its 'xlsx' use 'ACE Driver' or read xml within excel as recommneded by MS. If xls and you know its always going to be properly formatted  'jet Engine'  Code: Imports Microsoft.Office.Interop Private Function ConvertFile(ByVal SourceFolder As String, ByVal FileName As String, ByVal FileExtension As String)As Boolean     Dim appExcel As New Excel.Application     Dim workBooks As Excel.Workbooks = appExcel.Workbooks     Dim objWorkbook As Excel.Workbook      Try                   objWorkbook = workBooks.Open(CompleteFilePath )                            objWorkbook.SaveAs(Filename:=CObj(SourceFolder & FileName & ".csv"), FileFormat:=Excel.XlFileFormat.xlCSV)       Catch ex As Exception         GenerateAlert(ex.Message().Replace("'", "") & " Error Converting File to CSV.")         LogError(ex )         Return False      Finally                      If Not(objWorkbook is Nothing) then               objWorkbook.Close(SaveChanges:=CObj(False))           End If           ReleaseObj(objWorkbook)                                      ReleaseObj(workBooks)           appExcel.Quit()           ReleaseObj(appExcel)                                 Dim proc As System.Diagnostics.Process           For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")               proc.Kill()           Next         DeleteSourceFile(SourceFolder & FileName & FileExtension)     End Try  Return True  End Function   Private Sub ReleaseObj(ByVal o As Object)     Try      System.Runtime.InteropServices.Marshal.ReleaseComObject(o)   Catch ex As Exception           LogError(ex )   Finally      o = Nothing    End Try End Sub     Protected Sub DeleteSourceFile(Byval CompleteFilePath As string)         Try             Dim MyFile As FileInfo = New FileInfo(CompleteFilePath)             If  MyFile.Exists Then                 File.Delete(CompleteFilePath)             Else              Throw New FileNotFoundException()             End If         Catch ex As Exception             GenerateAlert( " Source File could not be deleted.")              LogError(ex)         End Try     End Sub  The code to kill the process ( Avoid it if you can ): Dim proc As System.Diagnostics.Process For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")     proc.Kill() Next

    Read the article

  • Setting an Excel Range with an Array using Python and comtypes?

    - by technomalogical
    Using comtypes to drive Python, it seems some magic is happening behind the scenes that is not converting tuples and lists to VARIANT types: # RANGE(“C14:D21”) has values # Setting the Value on the Range with a Variant should work, but # list or tuple is not getting converted properly it seems >>>from comtypes.client import CreateObject >>>xl = CreateObject("Excel.application") >>>xl.Workbooks.Open(r'C:\temp\my_file.xlsx') >>>xl.Visible = True >>>vals=tuple([(x,y) for x,y in zip('abcdefgh',xrange(8))]) # creates: #(('a', 0), ('b', 1), ('c', 2), ('d', 3), ('e', 4), ('f', 5), ('g', 6), ('h', 7)) >>>sheet = xl.Workbooks[1].Sheets["Sheet1"] >>>sheet.Range["C14","D21"].Value() (('foo',1),('foo',2),('foo',3),('foo',4),('foo',6),('foo',6),('foo',7),('foo',8)) >>>sheet.Range["C14","D21"].Value[()] = vals # no error, this blanks out the cells in the Range According to the comtypes docs: When you pass simple sequences (lists or tuples) as VARIANT parameters, the COM server will receive a VARIANT containing a SAFEARRAY of VARIANTs with the typecode VT_ARRAY | VT_VARIANT. This seems to be inline with what MSDN says about passing an array to a Range's Value. I also found this page showing something similar in C#. Can anybody tell me what I'm doing wrong? EDIT I've come up with a simpler example that performs the same way (in that, it does not work): >>>from comtypes.client import CreateObject >>>xl = CreateObject("Excel.application") >>>xl.Workbooks.Add() >>>sheet = xl.Workbooks[1].Sheets["Sheet1"] # at this point, I manually typed into the range A1:B3 >>> sheet.Range("A1","B3").Value() ((u'AAA', 1.0), (u'BBB', 2.0), (u'CCC', 3.0)) >>>sheet.Range("A1","B3").Value[()] = [(x,y) for x,y in zip('xyz',xrange(3))] # Using a generator expression, per @Mike's comment # However, this still blanks out my range :(

    Read the article

  • Redimming arrays in VBA

    - by Mike
    I have 3 arrays of data, that are filled by reading off of an excel sheet, some of the points of data are missing and as such have just been entered into excel as "NA" so I want to look through my array and find each instance of these NA's and remove them from the array since the information is useless. I need to update all three arrays at the same time. Sub group_data() Dim country(), roe(), iCap() As String Dim i As Integer For i = 1 To 3357 country(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("C1").Offset(i, 0) roe(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("AP1").Offset(i, 0) iCap(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("BM1").Offset(i, 0) Next i End Sub So if I find a "NA" as one of the values in roe or iCap I want to get rid of that piece of data in all there arrays.

    Read the article

  • Copying Data to a Master sheet from other sheets without duplicates

    - by sam
    I have four workbooks, three of which are for data entries, and the latter which hosts all data entered in the other workbooks; as a matter of fact, it serves as a master workbook. I need code to copy data entered in each workbook in sheet 1 to be copied to the next available row on sheet 1 of the master workbook, but if the data to be copied from these individual workbooks are duplicates, then a message box should pop up displaying that its a duplicate. To be precise, I want the users to type p in column j indicating process, and click a button in the spreadsheet to copy the data to the master sheet. I would be glad for any assistance. Thanks a million for any help.

    Read the article

1 2 3 4 5 6 7  | Next Page >