Search Results

Search found 4783 results on 192 pages for 'excel vba'.

Page 102/192 | < Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >

  • Shimmed Automation addin

    - by Sandy
    I am developing an Excel addin that has an udf and calls it as a worksheet function. It is a com addin where I am using the IDTExtensibility2 interface and set the class interface type as autodual and then shim it as in the link http://blogs.msdn.com/andreww/archive/2006/07/23/excel-interop-types-in-shimmed-automation-add-ins.aspx Things work fine in my development machine but I am having a tough time packaging the assembly. The addin registers but the formula does not appear in the formula bar of Excel after the installation. Can someone help me with the right way to get it done ? I use VS 2008 and Office 2007 for my testing. Thanks in advance.

    Read the article

  • DataGrid In Java Struts Web Application

    - by Anand
    Hi After scouring the web I have edited my question from the one below to what it is now. Ok I seem to understand that I don't need all the capabilities of excel right now. I think i am satisfied having a data grid to display data. Basically i am working on Struts 2 and I wat my jsp page to have an excel like feel and hence looks like even a datagrid is sufficient. I came across This Technology I am not sure whether I must go ahead and use it. Any other suggestions, alternatives are welcome The older version of the question "I have a java web application running on windows currently. I may host it in future in a Linux Server. My application allows people to upload data. I want to display the data they have uploaded in an excel file and render it in a portion of my webpage. How do I go about this ?"

    Read the article

  • Validate data before uploading through SSIS

    - by The King
    I have a SSIS package to upload data from Excel file into an Sql Server 2005 table. The excel file will have varied lines of data ranging from 20k - 30k lines. The upload works fine, when all the data are correct. But obviously fails when there is a small problem even in a single row. Examples like mandatory values presented null, inconvertable values (data type mismatch) etc. I want to validate the excel file before the upload and want to tell the user which row and column has got the error... Any idea as to how to accomplish this, without consuming much time and resources. Thanks

    Read the article

  • What encoding to use for exporting to CSV?

    - by Michael Borgwardt
    I'm developing a java app that exports data to CSV files, intended to be opened in Excel by end users. We just noticed that the export function uses Java's platform default encoding. This causes umlaut characters to be lost and unit test to fail on the build server (which is configured to have US-ASCII as its platform default encoding exactly to catch such potential problems). The question is: which would be the best encoding to use? How does Excel determine what encoding to use? Does it use something platform-specific that presumably matches Java's platform default? I'm currently leaning towards hardcoding Cp1252 - that should cover the target machines (the deployment environment is actually specified) and would fix the test problem. From googling around, Excel does not seem to handle UTF-8 well, so that's out, and sticking to the platform default encoding would require some sort of workaround hack for the tests.

    Read the article

  • How to read, edit and write xls files, and then export to SQL Server

    - by tuanvt
    I have an excel file that have the list of contacts( about 10 k of them) that I need to push into my SQL Server database. So, I am writing an .net windows program using visual studio 2008 to read the files, generate random password for each contact, and then push these information in to my SQL Server database. It was easy to handle excel file in 2003 but now my computer have office 2007 in it and things seem to changed. I am digging on Microsoft.Office.Interop.Excel but it is seem to be a lot more complicated than before.

    Read the article

  • Using Large Arrays in VB.NET

    - by Tim
    I want to extract large amounts of data from Excel, manipulate it and put it back. I have found the best way to do this is to extract the data from an Excel Range in to a large array, change the contents on the array and write it back to the Excel Range. I am now rewriting the application using VB.NET 2008/2010 and wish to take advantage of any new features. Currently I have to loop through the contents of the array to find elements with certain values; also sorting large arrays is cumbersome. I am looking to use the new features, including LINQ to manipulate the data in my array. Does anybody have any advice on the easiest ways to filter / query, sort etc. data in a large array. Also what are the reasonable limits to the size of the array? ~Many Thanks

    Read the article

  • Getting a Specified Cast is not valid while importing data from Excel using Linq to SQL

    - by niceoneishere
    This is my second post. After learning from my first post how fantastic is to use Linq to SQL, I wanted to try to import data from a Excel sheet into my SQL database. First My Excel Sheet: it contains 4 columns namely ItemNo ItemSize ItemPrice UnitsSold I have a created a database table with the following fields table name ProductsSold Id int not null identity --with auto increment set to true ItemNo VarChar(10) not null ItemSize VarChar(4) not null ItemPrice Decimal(18,2) not null UnitsSold int not null Now I created a dal.dbml file based on my database and I am trying to import the data from excel sheet to db table using the code below. Everything is happening on click of a button. private const string forecast_query = "SELECT ItemNo, ItemSize, ItemPrice, UnitsSold FROM [Sheet1$]"; protected void btnUpload_Click(object sender, EventArgs e) { var importer = new LinqSqlModelImporter(); if (fileUpload.HasFile) { var uploadFile = new UploadFile(fileUpload.FileName); try { fileUpload.SaveAs(uploadFile.SavePath); if(File.Exists(uploadFile.SavePath)) { importer.SourceConnectionString = uploadFile.GetOleDbConnectionString(); importer.Import(forecast_query); gvDisplay.DataBind(); pnDisplay.Visible = true; } } catch (Exception ex) { Response.Write(ex.Source.ToString()); lblInfo.Text = ex.Message; } finally { uploadFile.DeleteFileNoException(); } } } // Now here is the code for LinqSqlModelImporter public class LinqSqlModelImporter : SqlImporter { public override void Import(string query) { // importing data using oledb command and inserting into db using LINQ to SQL using (var context = new WSDALDataContext()) { using (var myConnection = new OleDbConnection(base.SourceConnectionString)) using (var myCommand = new OleDbCommand(query, myConnection)) { myConnection.Open(); var myReader = myCommand.ExecuteReader(); while (myReader.Read()) { context.ProductsSolds.InsertOnSubmit(new ProductsSold() { ItemNo = myReader.GetString(0), ItemSize = myReader.GetString(1), ItemPrice = myReader.GetDecimal(2), UnitsSold = myReader.GetInt32(3) }); } } context.SubmitChanges(); } } } can someone please tell me where am I making the error or if I am missing something, but this is driving me nuts. When I debugged I am getting this error when casting from a number the value must be a number less than infinity I really appreciate it

    Read the article

  • looking for advise on importing excel into mysql with php

    - by Ole Media
    Alright, see if I can pick your brains from you all. I'm currently working on a project where all the information comes from different clients, the only thing in common is that the received data is done with excel. The excel spread sheet that they present is just a bunch of references and codes, and the problem than I'm facing is that I need the references and codes to be entered in certain format in order for the website to work. The perfect situation will be to go to each client and teach how I would need the data, but I can't do that because of the large number of clients, and more importantly I will be interrupting their work flow. Each client has its own codes and reference model and they are not willing to change their process The good news is that there is a standard pattern for the codes, but I'm talking close to 200 thousand codes with a bunch of combination. They way that we are currently solving the problem is that we have a person who checks each excel sheet received, runs a few macros, and manually fixes those codes in which the macro was not able to fix. The person that is doing this, is already burn out and frustrated and I would like to automatize this process with php. Suggestions?

    Read the article

  • DSOFramer closing Excel doc in another window. If unsaved data in file, dsoframer fails to open with

    - by Steve
    I'm using Microsoft's DSOFramer control to allow me to embed an Excel file in my dialog so the user can choose his sheet, then select his range of cells; it's used with an import button on my dialog. The problem is that when I call the DSOFramer's OPEN function, if I have Excel open in another window, it closes the Excel document (but leaves Excel running). If the document it tries to close has unsaved data, I get a dialog boxclosing Excel doc in another window. If unsaved data in file, dsoframer fails to open with a messagebox: "Attempt to access invalid address". I built the source, and stepped through, and its making a call in its CDsoDocObject::CreateFromFile function, calling BindToObject on an object of class IMoniker. The HR is 0x8001010a "The message filter indicated that the application is busy". On that failure, it tries to InstantiateDocObjectServer by classid of CLSID Microsoft Excel Worksheet... this fails with an HRESULT of 0x80040154 "Class not registered". The InstantiateDocObjectServer just calls CoCreateInstance on the classid, first with CLSCTX_LOCAL_SERVER, then (if that fails) with CLSCTX_INPROC_SERVER. I know DSOFramer is a popular sample project for embedding Office apps in various dialogs and forms. I'm hoping someone else has had this problem and might have some insight on how I can solve this. I really don't want it to close any other open Excel documents, and I really don't want it to error-out if it can't close the document due to unsaved data. Update 1: I've tried changing the classid that's passed in to "Excel.Application" (I know that class will resolve), but that didn't work. In CDsoDocObject, it tries to open key "HKEY_CLASSES_ROOT\CLSID{00024500-0000-0000-C000-000000000046}\DocObject", but fails. I've visually confirmed that the key is not present in my registry; The key is present for the guid, but there's no DocObject subkey. It then produces an error message box: "The associated COM server does not support ActiveX document embedding". I get similar (different key, of course) results when I try to use the Excel.Workbook programid. Update 2: I tried starting a 2nd instance of Excel, hoping that my automation would bind to it (being the most recently invoked) instead of the problem Excel instance, but it didn't seem to do that. Results were the same. My problem seems to have boiled down to this: I'm calling the BindToObject on an object of class IMoniker, and receiving 0x8001010A (RPC_E_SERVERCALL_RETRYLATER) "The message filter indicated that the application is busy". I've tried playing with the flags passed to the BindToObject (via the SetBindOptions), but nothing seems to make any difference. Update 3: It first tries to bind using an IMoniker class. If that fails, it calls CoCreateInstance for the clsid as a "fallback" method. This may work for other MS Office objects, but when it's Excel, the class is for the Worksheet. I modified the sample to CoCreateInstance _Application, then got the workbooks, then called the Workbooks::Open for the target file, which returns a Worksheet object. I then returned that pointer and merged back with the original sample code path. All working now.

    Read the article

  • Easiest way to decrypt PGP-encrypted files from VBA (MS Access)

    - by stucampbell
    I need to write code that picks up PGP-encrypted files from an FTP location and processes them. The files will be encrypted with my public key (not that I have one yet). Obviously, I need a PGP library that I can use from within Microsoft Access. Can you recommend one that is easy to use? I'm looking for something that doesn't require a huge amount of PKI knowledge. Ideally, something that will easily generate the one-off private/public key pair, and then have a simple routine for decryption.

    Read the article

  • Is VB Really Case Insensitive?

    - by Otaku
    I'm not trying to start an argument here, but for whatever reason it's typically stated that VB is case insensitive and C languages aren't (and somehow that is a good thing). But here's my question: Where exactly is VB case insensitive? When I type... Dim ss As String Dim SS As String ...into the VS2008 IDE the second one has a warning of "Local variable 'SS' is already declared in the current block". In VBA VBE, it doesn't immediately kick an error, but rather just auto-corrects the case. Am I missing something here with this argument that VB is not case sensitive? (Also, if you know or care to answer, why would that be a bad thing?) EDIT: Why am I even asking this question? I've used VB in many of it's dialects for years now, sometimes as a hobbyist, sometimes for small business-related programs in a workgroup. As of the last 6 months I've been working on a big project, much bigger than I anticipated. Much of the sample source code out there is in C#. I don't have any burning desire to learn C#, but if there are things I'm missing out on that C# offers that VB doesn't (an opposite would be VB.NET offers XML Literals), then I'd like to know more about that feature. So in this case, it's often argued that C languages are case sensitive and that's good and VB is case insensitive and that is bad. I'd like to know A) how exactly is VB case insensitive because every single example in the code editor becomes case sensititive (meaning case gets corrected) whether I want it or not and B) is this compelling enough for me to consider moving to C# if VB.NET case is somehow limiting what I could do with code?

    Read the article

  • VBA for Access 2003 - DDL help with creating access file: setting the Autonumber data type

    - by Justin
    So I have the below VB that creates an access file in the default workspace, creates a table, create some fields in that table...just need to know the syntax for setting the first data type/field to autonumber...GUID, Counter, etc will not work as in Access SQL ' error handling usually goes here dim ws as workspace dim dbExample as database dim tblMain as TableDef dim fldMain as Field dim idxMain as Index set ws = workspace(0) set dbExample = ws.CreateDatabase('string file path') set tblMain = dbExample.CreateTableDef("tblMain") set fldMain = tblMain.CreateField("ID", 'right here I do not know what to substitute for dbInteger to get the autonumber type to work ) tblMain.Fields.Append fldMain etc to create other fields and indexes so in this line: set fldMain = tblMain.CreateField("ID", dbInteger) i need to replace the dbInteger with something that VB reconizes as the autonumber property. i have tried GUID, Counter, Autonumber, AutoIncrement....unfortunately none of these work anyone know the syntax I am missing here? Thanks, Justin

    Read the article

  • What's wrong with this regex (VBScript/Javascript flavor)

    - by OtherMichael
    I'm trying to run a regular expression in VBA code that uses Microsoft VBScript Regular Expressions 5.5 (should be the same as JavaScript regex) regex: ^[0-9A-Z]?[0-9A-Z]{3}[A-Z]?([0-9A-Z]{6})-?([0-9])?$ input: X123A1234567 match: 123456 the six characters I'm interested in give a good match of 123456, ignoring the last (check) digit. Perfect. (The check digit is captured, but it's not a major concern to me). But when BOTH the optional portions are gone (they are optional) the match grabs the last digit GOOD input: 123A1234567 match: 123456 Leave in the optional middle alpha, take out the optional leading alpha, and we still get the good match of 123456 GOOD input: X1231234567 match: 123456 Leave in the optional leading alpha, take out the middle optional alpha, and we still get a good match of 123456 BAD input: 1231234567 match: 234567 Take out BOTH optional alphas, and we get a bad match of 234567 Have a looksee @ the regex testers on http://www.regular-expressions.info/javascriptexample.html or http://www.regular-expressions.info/vbscriptexample.html What am I missing, here? How can I get the regex to ignore the last digit when both optional alphas are missing? The regex is used to feed a lookup system, so that no matter what format the input data, we can match to a complete value.

    Read the article

  • How to return a recordset from a function

    - by Scott
    I'm building a data access layer in Excel VBA and having trouble returning a recordset. The Execute() function in my class is definitely retrieving a row from the database, but doesn't seem to be returning anything. The following function is contained in a class called DataAccessLayer. The class contains functions Connect and Disconnect which handle opening and closing the connection. Public Function Execute(ByVal sqlQuery as String) As ADODB.recordset Set recordset = New ADODB.recordset Dim recordsAffected As Long ' Make sure we are connected to the database. If Connect Then Set command = New ADODB.command With command .ActiveConnection = connection .CommandText = sqlQuery .CommandType = adCmdText End With ' These seem to be equivalent. 'Set recordset = command.Execute(recordsAffected) recordset.Open command.Execute(recordsAffected) Set Execute = recordset recordset.ActiveConnection = Nothing recordset.Close Set command = Nothing Call Disconnect End If Set recordset = Nothing End Function Here's a public function that I'm using in cell A1 of my spreadsheet for testing. Public Function Scott_Test() Dim Database As New DataAccessLayer 'Dim rs As ADODB.recordset 'Set rs = CreateObject("ADODB.Recordset") Set rs = New ADODB.recordset Set rs = Database.Execute("SELECT item_desc_1 FROM imitmidx_sql WHERE item_no = '11001'") 'rs.Open Database.Execute("SELECT item_desc_1 FROM imitmidx_sql WHERE item_no = '11001'") 'rs.Open ' This never displays. MsgBox rs.EOF If Not rs.EOF Then ' This is displaying #VALUE! in cell A1. Scott_Test = rs!item_desc_1 End If rs.ActiveConnection = Nothing Set rs = Nothing End Function What am I doing wrong?

    Read the article

  • Using INSERT INTO and setting one field value - Access VBA

    - by glinch
    Hi, I'm using INSERT INTO to copy rows of data from one table to another: INSERT INTO tblNewCustomers (CustomerID, [Last Name], [First Name]) SELECT CustomerID, [Last Name], [First Name] FROM tblOldCustomers How can I set one of the field values in tblNewCustomers for all of the new records that I am importing in withn this statement e.g tblNewCustomers.existCustomer = TRUE Thanks in advance for any help Noel

    Read the article

  • MS Access 2003 - Save button enabling on form open on different tabs

    - by Justin
    I have a tab control on a form, and a couple different tabs have save buttons on them. Once the user saves data (via SQL statements in VBA), I set the .enabled = false so that they cannot use this button again until moving to a brand new record (which is a button click on the overall form). so when my form open i was going to reference a sub that enabled all these save buttons because the open event would mean new record. though i get an error that says it either does not exist, or is closed. any ideas? thanks EDIT: Sub Example() error handling Dim db as dao.database dim rs as dao.recordset dim sql as string SQL = "INSERT INTO tblMain (Name, Address, CITY) VALUES (" if not isnull (me.name) then sql = sql & """" & me.name & """," else sql = sql & " NULL," end if if not insull(me.adress) then sql = sql & " """ & me.address & """," else sql = sql & " NULL," end if if not isnull(me.city) then sql = sql & " """ & me.city & """," else sql = sql & " NULL," end if 'debug.print(sql) set db = currentdb db.execute (sql) MsgBox "Changes were successfully saved" me.MyTabCtl.Pages.Item("SecondPage").setfocus me.cmdSaveInfo.enabled = false and then on then the cmdSave needs to get re enabled on a new record (which by the way, this form is unbound), so it all happens when the form is re-opened. I tried this: Sub Form_Open() me.cmdSaveInfo.enabled = true End Sub and this is where I get the error stated above. So this is also not the tab that has focus when the form opens. Is that why I get this error? I cannot enable or disable a control when the tab is not showing?

    Read the article

  • Auto accept outlook VBA

    - by Russ
    Is there a VB macro or some sort of add-on out there that will allow me to auto accept invitations in outlook by sender or by folder? I was thinking about doing a VB script for this but I don't want to re-invent the wheel?

    Read the article

  • Using an embedded Word document to create a new instance of that document.

    - by jim
    For a variety of reasons that are immutable ... I have a Word document which contains a VBA application (the 'app document') which creates a new document based on another document (the 'template') which contains the framework for the new document. I want to embed the 'template' into the 'app document' so that I deliver one file and I know I am using the correct version of the 'template'. I have, so far, embedded the 'template' file into the 'app document' and can find it by looping through "ThisDocument.InlineShapes", looking at .Field.OleFormat.IconLabel to find the 'template' by its name. The inlineShape.Field.OleFormat.Object is the 'template' document itself, and I can .Activate it, which causes it to appear as a regular document. I try to do SaveAs, and it does in fact save the file as the name I give it, however, that saved-as file is not left open, just the embedded file. I can not .Activate the file and just save it, then open the saved file, but that seems more work than necessary. So ... is the way I am doing this "the way", or I have missed some obvious practice? TIA

    Read the article

  • Data Validation of a Comma Delimited List

    - by Brad
    I need a simple way of taking a comma seperated list in a cell, and providing a drop down box to select one of them. For Example, the cell could contain: 24, 32, 40, 48, 56, 64 And in a further cell, using Data Validation, I want to provide a drop-down list to select ONE of those values I need to do this without VBA or Macros please. Apolgies, I want this to work with Excel 2010 and later. I have been playing around with counting the number of commas in the list and then trying to split this into a number of rows of single numbers etc with no joy yet.

    Read the article

  • Counting character count in Access database column ins SQL

    - by jzr
    Good Evening. My problem is possibly very easy, I just have spent some time researching now and probably have a brain lock and unable to solve this, help would be much appreciated. database structure: col1 col2 col3 col4 ==================== 1233+4566+ABCD+CDEF 1233+4566+ACD1+CDEF 1233+4566+D1AF+CDEF I need to count character count in col3, wanted result in from the previous table would be: char count =========== A 3 B 1 C 2 D 3 F 1 1 2 is this possible to achieve by using SQL only? at the moment I am thinking of passing a parameter in to SQL query and count the characters one by one and then sum, however I did not start the VBA part yet, and frankly wouldn't want to do that. this is my query at the moment: PARAMETERS X Long; SELECT First(Mid(TABLE.col3,X,1)) AS [col3 Field], Count(Mid(TABLE.col3,X,1)) AS Dcount FROM TEST GROUP BY Mid(TABLE.col3,X,1) HAVING (((Count(Mid([TABLE].[col3],[X],1)))>=1)); ideas and help are much appreciated, as being said this is probably very for some of your guys, I don't usually work with access and SQL. Thanks.

    Read the article

  • standard deviation on excel

    - by user270692
    so I have 3 data sets, which all came from the first data set using the excel program. all consisted of random numbers from =randbetween(0,100) starting from A2:A102 which is 100 integers. for data set b I had to enter=SUM(A2+5) press enter and drag it down to get the integers for cells B2:B102 and for C I had to do multiplication t get it. I did =PRODUCT(A2:A102*5). so everything was taken from data set A. now I did the formulas needed to do sample standard dev and mean(average) . for data set a and b the standard deviations were the same but the mean was larger in data set B of course because I added 5 to each cell in set A. my question is why wouldn't the standard deviation be the same for data set C also? if im using the info from data set A? and how do I calculate the standard deviation (sample) by hand so I can explain why the standard dev doesn't change but the mean does. I don't know what numbers to include in the formula for sample standard deviation.

    Read the article

  • Sorting in Pivot Table on how data is summarized, not just the value

    - by user26453
    Often I am creating pivot tables that summarize some count by some category. Let's say I am counting Yes/No responses by some category. I usually add the count field and display it as a "% of row", and then create a pivot chart. However, if I want to sort one of the columns, say "Yes", Excel sorts by the underlying count, not the calculated percentage. Any way around this?

    Read the article

  • Circle values that don't match any of the ones in a dropdown list

    - by Robert4242
    I created a dropdown list with values and assigned them to one of the columns in a table. When I changed a few, then changed the name of items in the list and removed some I accidentally did some key combination somewhere around Ctrl+Z or Ctrl+Y and Excel highlighted cells in the table that had a value not on the list. The highlighting looks like a red oval around each such cell. How can I toggle it on and off?

    Read the article

< Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >