Search Results

Search found 565 results on 23 pages for 'xls'.

Page 11/23 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Can Google Chrome open local links?

    - by Andy
    I am linking on an intranet page to a local file on a shared drive: <a href="file:///s:/test.xls"> Test</a> This works in IE and Firefox with an addon called local link. How can i get this to open in google chrome? Thanks

    Read the article

  • Sort a data grid based on a specified column.

    - by o vamsi krishna
    Developed a winform project using VB 2008. I'm using a .xls sheet as source. My appln has 7 columns and unspecified rows. I want to sort all the columns based on a specified column and allot a serial number as per the sorted order. If two items in the specified column are same we should consider another column for the equal items and sort them in that order. plz help me in this issue.

    Read the article

  • FilePath in xml file

    - by sanjeev40084
    In C#, Whenever i need to get file path more dyanmically, i do something like this string filePath = System.IO.Path.GetFullPath(@"..\..\TestData\TestFile.xls"); Is there anyway, i can mention same file path in xml file. <ConfigValue name ="filePath" value="<filepath like above>"/>

    Read the article

  • C#. Document conversion to PDF

    - by Umar Siddique
    Hi. I need to convert below mentioned file formats to pdf using C#/VB.Net. User will upload the file using FileUpload control and system will returns the pdf file after converting the document. doc/docx to pdf xls/xlsx to pdf ppt/pps to pdf Does ITextSharp provide such facility ? Please Only mentioned open source or free libraries. Thanks

    Read the article

  • Using Excel VBA to send emails. Problem with attachments becoming embedded by accident.

    - by Alexei
    Hi, I am having an issue with an Excel macro I wrote that is used by several users within my company. It is used to send numerous emails daily with attachments that are also Excel workbooks. The issue is that sometimes, instead of the file simply being attached as it should be, it becomes an embedded object. This embedded object is openable by users on the email within the company (after clicking through the "YOu are about to activate an embedded object that may contain viruses or be otherwise harmful to your computer. It is important to be certain that it is from a trustworthy source. Do you want to continue?"), but those outside of the company do not see it at all. The email appears to have no attachment at all. Curiously, this appears to happen randomly, and only on some computers. So if the list has 15 email lists and attachments, it seems to happen randomly to anywhere between 0 and 15 of the emails. To be clear, my objective is to send emails with regular attachments. Running Excel 2003, Outlook 2003, and Windows XP. See code below. Please help! Sub Email() Dim P As String Dim N As String Dim M As String Dim Subject As String Dim Addresses As String Dim olApp As Outlook.Application Dim olNewMail As Outlook.MailItem Application.DisplayAlerts = False M = ActiveWorkbook.Name For c = 2 To 64000 If Range("B" & c) = "" Then Exit For If UCase(Range("E" & c)) = "Y" Then Workbooks(M).Sheets("Main").Activate Subject = Range("A" & c) Addresses = Range("B" & c) P = Range("C" & c) N = Range("D" & c) If Right(P, 1) <> "\" Then P = P & "\" If Right(N, 4) <> ".xls" Then N = N & ".xls" Set olApp = New Outlook.Application Set olNewMail = olApp.CreateItem(olMailItem) With olNewMail .Display .Recipients.Add Addresses Application.Wait (Now + TimeValue("0:00:01")) SendKeys ("{TAB}") .Subject = Subject .Attachments.Add P + N .Send End With Set olNewMail = Nothing Set olApp = Nothing End If Next c Range("E2:E65536").ClearContents Application.DisplayAlerts = True End Sub

    Read the article

  • Calling an Excel Add-In method from C# application or vice versa

    - by Jude
    I have an Excel VBA add-in with a public method in a bas file. This method currently creates a VB6 COM object, which exists in a running VB6 exe/vbp. The VB6 app loads in data and then the Excel add-in method can call methods on the VB6 COM object to load the data into an existing Excel xls. This is all currently working. We have since converted our VB6 app to C#. My question is: What is the best/easiest way to mimic this behavior with the C#/.NET app? I'm thinking I may not be able to pull the data from the .NET app into Excel from the add-in method since the .Net app needs to be running with data loaded (so no using a stand-alone C# class library). Maybe we can, instead, push the data from .NET to Excel by accessing the VBA add-in method from the C# code? The following is the existing VBA method accessing the VB6 app: Public Sub UpdateInDataFromApp() Dim wkbInData As Workbook Dim oFPW As Object Dim nMaxCols As Integer Dim nMaxRows As Integer Dim j As Integer Dim sName As String Dim nCol As Integer Dim nRow As Integer Dim sheetCnt As Integer Dim nDepth As Integer Dim sPath As String Dim vData As Variant Dim SheetRange As Range Set wkbInData = wkbOpen("InData.xls") sPath = g_sPathXLSfiles & "\" 'Note: the following will bring up fpw app if not already running Set oFPW = CreateObject("FPW.CProfilesData") If oFPW Is Nothing Then MsgBox "Unable to reference " & sApp Else . . . sheetCnt = wkbInData.Sheets.Count 'get number of sheets in indata workbook For j = 2 To sheetCnt 'set counter to loop over all sheets except the first one which is not input data fields With wkbInData.Worksheets(j) Set SheetRange = .UsedRange End With With SheetRange nMaxRows = .Rows.Count 'get range of sheet(j) nMaxCols = .Columns.Count 'get range of sheet(j) Range(.Cells(2, 2), .Cells(nMaxRows, nMaxCols)).ClearContents 'Clears data from data range (51 Columns) Range(.Cells(2, 2), .Cells(nMaxRows, nMaxCols)).ClearComments End With With oFPW 'vb6 object For nRow = 2 To nMaxRows ' loop through rows sName = SheetRange.Cells(nRow, 1) 'Field name vData = .vntGetSymbol(sName, 0) 'Check if vb6 app identifies the name nDepth = .GetInputTableDepth(sName) 'Get number of data items for this field name from vb6 app nMaxCols = nDepth + 2 'nDepth=0, is single data item For nCol = 2 To nMaxCols 'loop over deep screen fields nDepth = nCol - 2 'current depth vData = .vntGetSymbol(sName, nDepth) 'Get Data from vb6 app If LenB(vData) > 0 And IsNumeric(vData) Then 'Check if data returned SheetRange.Cells(nRow, nCol) = vData 'Poke the data in Else SheetRange.Cells(nRow, nCol) = vData 'Poke a zero in End If Next 'nCol Next 'nRow End With Set SheetRange = Nothing Next 'j End If Set wkbInData = Nothing Set oFPW = Nothing Exit Sub . . . End Sub Any help would be appreciated.

    Read the article

  • excel - inserting data with OleDb c#

    - by Cmptrb
    Hi, my code is below: private string connectionstring = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myexcel.xls; Extended Properties=""Excel 8.0;HDR=YES;"""; this is my connection string, the excel file is created writable (not readonly) either my command to insert any data is : string commandstring = "insert into [mus$] (name, surname) values('mickey', 'mouse')"; But my commandstring does not work and gives the error: "number of query values and destination fields are not the same" Where I do mistake ?

    Read the article

  • Execute SQL SP in Excel VBA

    - by TheOCD
    HI I am having problem with getting all the columns back when i execute following code in excel vba. I only get 6 out of 23 columns back. Connection, command etc works fine (i can see exec command in the SQL Profiler), data headers are created for all 23 columns but i only get data for 6 column. Side Note: it's not prod level code, have missed out error handling on purpose, sp works fine in SQL management studio, ASP.Net, C# win form app, it is for Excel 2003 connecting to SQL 2008. Can someone help me troubleshoot it? Dim connection As ADODB.connection Dim recordset As ADODB.recordset Dim command As ADODB.command Dim strProcName As String 'Stored Procedure name Dim strConn As String ' connection string. Dim selectedVal As String 'Set ADODB requirements Set connection = New ADODB.connection Set recordset = New ADODB.recordset Set command = New ADODB.command If Workbooks("Book2.xls").MultiUserEditing = True Then MsgBox "You do not have Exclusive access to the workbook at this time." & _ vbNewLine & "Please have all other users close the workbook and then try again.", vbOKOnly + vbExclamation Exit Sub Else On Error Resume Next ActiveWorkbook.ExclusiveAccess 'On Error GoTo No_Bugs End If 'set the active sheet Set oSht = Workbooks("Book2.xls").Sheets(1) 'get the connection string, if empty just exit strConn = ConnectionString() If strConn = "" Then Exit Sub End If ' selected value, if <NOTHING> just exit selectedVal = selectedValue() If selectedVal = "<NOTHING>" Then Exit Sub End If If Not oSht Is Nothing Then 'Open database connection connection.ConnectionString = strConn connection.Open ' set command stuff. command.ActiveConnection = connection command.CommandText = "GetAlbumByName" command.CommandType = adCmdStoredProc command.Parameters.Refresh command.Parameters(1).Value = selectedVal 'Execute stored procedure and return to a recordset Set recordset = command.Execute() If recordset.BOF = False And recordset.EOF = False Then Sheets("Sheet2").[A1].CopyFromRecordset recordset ' Create headers and copy data With Sheets("Sheet2") For Column = 0 To recordset.Fields.Count - 1 .Cells(1, Column + 1).Value = recordset.Fields(Column).Name Next .Range(.Cells(1, 1), .Cells(1, recordset.Fields.Count)).Font.Bold = True .Cells(2, 1).CopyFromRecordset recordset End With Else MsgBox "b4 BOF or after EOF.", vbOKOnly + vbExclamation End If 'Close database connection and clean up If CBool(recordset.State And adStateOpen) = True Then recordset.Close Set recordset = Nothing If CBool(connection.State And adStateOpen) = True Then connection.Close Set connection = Nothing Else MsgBox "oSheet2 is Nothing.", vbOKOnly + vbExclamation End If

    Read the article

  • ASP.Net export to excel + File Download dialog action.

    - by Muhammad Umar Siddique
    i m trying to export data from asp.net form to excel using following lines of code Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("content-disposition", "attachment; filename=Report.xls"); Everything seems to be working fine. Now what I need it to take some action if user clicks the "Cancel" button on File Download dialog. How i can do this ? thanks..

    Read the article

  • Can't read excel file after creating it using File.WriteAllText() function

    - by Srikanth Mattihalli
    public void ExportDataSetToExcel(DataTable dt) { HttpResponse response = HttpContext.Current.Response; response.Clear(); response.Charset = "utf-8"; response.ContentEncoding = Encoding.GetEncoding("utf-8"); response.ContentType = "application/vnd.ms-excel"; Random Rand = new Random(); int iNum = Rand.Next(10000, 99999); string extension = ".xls"; string filenamepath = AppDomain.CurrentDomain.BaseDirectory + "graphs\\" + iNum + ".xls"; string file_path = "graphs/" + iNum + extension; response.AddHeader("Content-Disposition", "attachment;filename=\"" + iNum + "\""); string query = "insert into graphtable(graphtitle,graphpath,creategraph,year) VALUES('" + iNum.ToString() + "','" + file_path + "','" + true + "','" + DateTime.Now.Year.ToString() + "')"; try { int n = connect.UpdateDb(query); if (n > 0) { resultLabel.Text = "Merge Successfull"; } else { resultLabel.Text = " Merge Failed"; } resultLabel.Visible = true; } catch { } using (StringWriter sw = new StringWriter()) { using (HtmlTextWriter htw = new HtmlTextWriter(sw)) { // instantiate a datagrid DataGrid dg = new DataGrid(); dg.DataSource = dt; //ds.Tables[0]; dg.DataBind(); dg.RenderControl(htw); File.WriteAllText(filenamepath, sw.ToString()); // File.WriteAllText(filenamepath, sw.ToString(), Encoding.UTF8); response.Write(sw.ToString()); response.End(); } } } Hi all, I have created an excel sheet from datatable using above function. I want to read the excel sheet programatically using the below connectionstring. This string works fine for all other excel sheets but not for the one i created using the above function. I guess it is because of excel version problem. OleDbConnection conn= new OleDbConnection("Data Source='" + path +"';provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;";); Can anyone suggest a way by which i can create an excel sheet such that it is readable again using above query. I cannot use Microsoft InterOp library as it is not supported by my host.

    Read the article

  • File Formats Supported by UIWebView

    - by Mugunth Kumar
    What are all the file formats supported by UIWebView? In my testing, I found that it supports XLS, DOC, PPT, PDF but not XLSX, and DOCX, RTF. It supports image files like, JPG, PNG, GIF, BMP, not sure about TIFF or Exactly, what all types are supported is not clear... The UIWebView documentation also doesn't state it clearly. Could someone please help?

    Read the article

  • I can't Open my excel file in c#

    - by Ruben Guico
    Hi, Below is my code, i tried to open my excel file in my c# application but the program give's me an error message "Cannot Access "my excel.xls". But when I specify the file path in my string path variable it works, the problem is I need to get the file path from an openFileDialog. using System; using System.IO; using System.Collections.Generic; using System.Text; using System.Data; using System.Windows.Forms; using System.Data.OleDb; using System.Reflection; using MOIE = Microsoft.Office.Interop.Excel; using OFFICE = Microsoft.Office.Core; namespace EmpUploader { public class ExcelCon { private OleDbDataReader reader = null; private OleDbCommand excelCommand = new OleDbCommand(); private OleDbDataAdapter adapter = new OleDbDataAdapter(); private DataTable excelData = new DataTable(); private MOIE.ApplicationClass objExcel = new MOIE.ApplicationClass(); private MOIE.Workbook wb = null; private string myConn = ""; private string strSQL = ""; private string err = ""; private string path2 = ""; private int sheetCount = 0; private OleDbConnection Con = new OleDbConnection(""); #region "excel interop prarameters" private static object xl_missing = Type.Missing; private static object xl_true = true; private static object xl_false = false; private object xl_update_links = xl_missing; private object xl_read_only = xl_missing; private object xl_format = xl_missing; private object xl_password = xl_missing; private object xl_write_res_password = xl_missing; private object xl_ignore_read_only = xl_missing; private object xl_origin = xl_missing; private object xl_delimiter = xl_missing; private object xl_editable = xl_missing; private object xl_notify = xl_missing; private object xl_converter = xl_missing; private object xl_add_to_mru = xl_missing; private object xl_local = xl_missing; private object xl_corrupt_load = xl_missing; #endregion } //MY CODE FOR OPENING THE EXCEL //note that my file path came from an openfiledialog public void InitializeConnection(string path) { //connection string for excel myConn = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + path + "; Extended Properties =Excel 8.0"; Con.ConnectionString = myConn; Con.Open(); //this is the sample specified path that worked when i test my application //path = @"C:\shinetsu p5 emp list.xls"; objExcel.Visible = false; wb = objExcel.Workbooks.Open(path, xl_update_links, xl_read_only, xl_format, xl_password, xl_write_res_password, xl_ignore_read_only, xl_origin, xl_delimiter, xl_editable, xl_notify, xl_converter, xl_add_to_mru, xl_local, xl_corrupt_load); sheetCount = wb.Worksheets.Count; } }

    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

  • update SQl table from values in excel

    - by user175084
    I am using the SQL Developer or SQl express. How do i get the values from an excel sheet and update those in a column of my database... Please help thanks. i have this and im running it but i get error: SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\books.xls', 'SELECT * FROM [Sheet1$]') i get error now OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Could not find installable ISAM.". thanks

    Read the article

  • Reading Excel files from C#

    - by dbkk
    Is there a free or open source library to read Excel files (.xls) directly from a C# program? It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd like to eliminate the manual step.

    Read the article

  • Making an Excel file into a link in VBA.

    - by Edmond
    Mvalue = MonthName(5, True) fileL = \bobby\outside\" myFile = fileL & Mvalue & Right(Year(Date), 2) & "\Goodbye - " & myfdate & ".xls" Set omail = CreateItem(olMailItem) With omail .Subject = "Hello" .BodyFormat = olFormatHTML .HTMLBody = myFile How do I make the.HTMLBody = myFile, into a link within the email that will be sent out

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >