excel

Expressing Excel formula in Java (decimal to time interpretation)

Hi, I am converting an excel sheet formula to java but I can't understand how excel manages to take the following: 0.22 Applies a formula: =TEXT(R5/14, "h:mm") and somehow arrives at: 0.22 Again if I provide: 2.8 it arrives at 4.48 Can someone please explain to me how it does this. I have read a little regarding decimal and I understand...

cannot access excel file after renaming

I have renamed some excel files on my web server and after renaming the users cannot download those files. What could be the problem. They are all excel files. ...

How to capture the "Print" button from the menu bar in a macro

I have a sheet with a custom button on it from where I control the printing process. Now the user clicks on the menu bar's print icon and this produces an "undefined" output. How can I intercept this menu bar button? Thanks ...

Programatically creating Excel 2007 Sheets

I'm trying to create Excel 2007 Documents programatically. Now, there are two ways I've found: Manually creating the XML, as outlined in this post Using a Third Party Library like ExcelPackage. Currently, I use ExcelPackage, which has some really serious drawbacks and issues. As I do not need to create overly complex Excel sheets (th...

How do you get Excel to refresh data on sheet from within VBA?

How do you get spreadsheet data in Excel to recalculate itself from within VBA, without the kluge of just changing a cell value? ...

How do I put a File (Excel) online (Apache Server) with Password Protection but with the Option for Users to alter the File and save the changes?

I have to put an excel file online on a web server (Apache) with some basic password protection (basic http auth). User, however, should be able to open the file from within excel and save their changes back to the server. Is there any simple and effective solution for it? I am not very experienced with webdav. ...

Microsoft Excel mangles Diacritics in .csv files?

I am programmatically exporting data (using PHP 5.2) into a .csv test file. Example data: Numéro 1 (note the accented e). The data is utf-8 (no prepended BOM) When I open this file in MS excel is displays as Numéro 1 I am able to open this in a text editor (UltraEdit) which displays it correctly. UE reports the character is decim...

How to write an Excel workbook to a MemoryStream in .NET?

How do I write an Excel workbook to a MemoryStream without first saving it to the file system? All options within the Microsoft.Office.Interop.Excel.WorkBook save options take a filename. ...

How can I send an HTTP POST request to a server from Excel using VBA?

What VBA code is required to peform an HTTP POST from an Excel spreadsheet? Accepted Answer Note: For greater control over the HTTP request you can use "WinHttp.WinHttpRequest.5.1" in place of "MSXML2.ServerXMLHTTP" ...

How to properly clean up Excel interop objects in C#

I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause: while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { } excelSheet = null; GC.Collect(); GC.WaitForPendingFinalizers(); Although, this kind of works the Excel.exe process is still in the background...

How to open existing file using COM/ATL (no MFC)

I have an existing Windows C++ application that links to ATL. I need to open an existing Excel file and access some properties. One of the things I need to do is determine if the user is currently viewing the Excel file. We can assume that the user has Excel installed, although not sure which version. What is the C++ / COM code to at...

How do I create an Excel chart that pulls data from multiple sheets?

I have monthly sales figures stored in separate sheets. I would like to create a plot of sales for multiple products per month. Each product would be represented in a different colored line on the same chart with each month running along the x axis. What is the best way to create a single line chart that pulls from the same relative c...

Why does my Excel export have a blank row at the top?

In ASP.NET, I am exporting some data to Excel by simply binding a DataSet to a GridView and then setting the ContentType to Excel. My ASPX page is very simple and looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExamExportReport.aspx.cs" Inherits="Cabi.CamCentral.Web.Pages.Utility.ExamExportReport" %> <html> <...

CSV file. Excel is automatically converting my text to a date. Bad Excel.

Does anyone happen to know if there is a token I can add to my csv for this field so Excel doesn't try to convert it? I'm trying to write a csv file from my application and one of the values happens to look enough like a date that Excel is automatically converting it from text to a date. I've tried putting all of my text fields (includ...

How to convert a DB2 date-time string into an Excel Date

I'll regularly get an extract from a DB/2 database with dates and timestaps formatted like this: 2002-01-15-00.00.00.000000 2008-01-05-12.36.05.190000 9999-12-31-24.00.00.000000 Is there an easier way to convert this into the Excel date format than decomposing with substrings? DB2date = DateValue(Left(a, 4) + "/" + Mid(a, 6, 2) + "/"...

.Net Localization problem

I am currently building an Excel 2007 Add-in using VSTO (latest version + sp1) and .Net 3.5 The code simply takes the position a chart using the Top and Left properties and stores it in an XML file. The problem im facing is that when the xml is generated using a Vista Ultimate + Excel 2007 + English environment the code works perfectly...

How can I export the data in a DataGridView data to an Excel spreadsheet?

In my Winforms application, I want to export the data from my DataGridView to a Excel spreadsheet. Is it simply a job of looping and outputting the results comma seperated? ...

How can I GZip compress a file from Excel VBA using code in an .xla file only?

I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm. Is there a way to do this without having to exec a command line application? With no dependency on external tools the code will be more robust. Ideally the code would make use of pre-installed VBA or COM li...

How do I show an embedded excel file in a WebPage?

I want to allow an Excel report to be viewed embedded in a WebPage... is there a way? I don't want to use an ActiveX, or OWC (Office Web Components), I just want to open an existing file from the internet explorer application. I don't want users to download and then open it. Using an iframe wouldn't be a problem, but my preliminary t...

How do I base64 encode a string efficiently using Excel VBA?

I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from dbb and marxidad)? ...