excel

VSTO in Excel: The customization does not have the required permissions to execute.

At the very beginning. Created a new Excel Workbook from VS2005. Try to save it? Cannot access the .xls file. Try to run it? same error, plus the customization permissions error in the title. Where do I set the permission? EDIT I've read a few SO questions and answers around this and it all seems terribly over-complicated. Give me...

Adding up all the positive numbers in Excel

Is there a way to add up all of the positive numbers in a row/column but ignoring all of the negative numbers? Like SUM(), except that it ignores negative numbers. Would I have to use VBA? If so, how would I do it in VBA? If it can't be done in Excel, can it be done in OpenOffice Calc? ...

Excel VBA 424 Object Required Runtime Error

As an exercise, I'm trying to set all the values in the range A1:V35 to "omg". The following code produces an error: Sub ktr() Dim colIndex As Integer Dim rowIndex As Integer Dim dataRange As Range Set dataRange = Range("A1:V35") Cells(1, 1) = dataRange.Columns.Count For colIndex = 1 To dataRange.Columns.Cou...

VBA and Private Functions

For some reason, nothing happens when I run this macro. What might I be doing wrong? (I'm trying to fill each cell in the range with a randomly selected string.) Sub ktr() Dim dataRange As Range Set dataRange = Range("A1:V35") For Each cell In dataRange response = azerothSays() cell.Value = response N...

Excel and IE7 - Prevent IE from opening Excel files

I have a intranet webpage that is used to hyperlink to various files on a file server. The problem with the local-file linking is that Microsoft Excel files are opened in IE7 instead of Excel. This results in the Excel files VBA code and other features from working correctly. Is there a way using HTML/Javascript to force the file to be ...

Excel copy worksheet

In Excel VBA (or if you could in C#, I'm using the Excels Object Library from .NET), how to copy a worksheet from one workbook to another sheet in another workbook. Basically, what I'm doing is copying every of my sheet into a central worksheet in another workbook and then will do all the stuff I need to do there. I tried using Range.Cop...

Problem while copying JTable contents into Excel

I have a Standalone application in which I am trying to copy contents of JTable into Excel with line breaks included in my cells of JTable. I have used wrapping using "\"" to my cell contents. It's working fine but I am getting a square box type of symbol in place of line breaks in Excel. How to remove the symbol while copying? Is there ...

can't set PageSetup.Orientation = xlLandscape from MS Project

Using VBA in MS Project 2003 I create an Excel sheet and write data to it. After that I want to change SetPrintArea and Orientation of the sheet I created so I wrote with xlsheet '// Defined being an Excel.Worksheet For i = 1 To .UsedRange.Columns.Count .Columns(i).EntireColumn.AutoFit Next i ...

Automatically execute an excel macro on a cell changed by a real-time add-in

I have an Excel add-in (Bloomberg) which streams real-time prices into a spreadsheet. I need to add a column which contains the last time a price was updated. I've tried to do this with the worksheet change event, but this doesn't seem to get fired by the changes (I assume something to do with it being a real-time update). The requireme...

Excel, multiple if statements

I'm in over my head on this one. Can anyone write an if statement for one cell with the following conditions: if BB>0, B6>0, BA<-.3, BA>-1.2 THEN O11-.1 if BB>0, B6<0, BA>.3 THEN O11+.1 Leave cell blank if neither condition is met. Is this possible? Thanks ...

Excel Embeded If Statements

In excel is it bad to have about 1000 embedded if statements? I have about 1000 options that I want to pre-populate in other excel fields, what is the best way to do this other then inefficient if statements? ...

Excel VBA: Subtotals?

I have data of this form: Category Source Amount Dues FTW $100 Donations ODP $20 Donations IOI $33 Dues MMK $124 Where there is no sort order. I want a VBA macro to cycle through the range, output a list of distinct values, with the subtotals for each. For the above d...

Excel: Formula to reference an entire pivot table?

I have a bunch of sheets with detailed data sets and pivot tables. On a summary sheet, I want to display just the pivot tables. (Of course, I'd rather stay DRY and not create a whole new set.) How can I reference the old pivot tables? I can use VBA to do this if necessary. ...

Using sax writer to create line feeds in a xml 2003 workbook

Hi stackoverflow comunity, using a sax writer with the progress-4gl language i succeeded in creating an a xml 2003 workbook. My problem began when i wanted to add a linefeed to a cell. The normal linefeed for excel (in xml) is made using " ", this is a problem because the sax-writer converts & to &amp. I did find a workaround by usin...

Handling office open xml (xlsx) documents with PHP

Hi all, I need to create sort of a php based Excel (xslx) handling component. I figured that there are several open source projects around which are into this. Does anyone has particular experiences / advice on this for me? I.e. which one to go with, which one is to be avoided? I tend to go with PHP-Excel. thx in advance for your thou...

Deleting TableStyle from excel

Hi, I have added a TableStyle to excel workbook using the statement: ActiveWorkbook.TableStyles.Add("PivotTable SS") I can delete it using: ActiveWorkbook.TableStyles("PivotTable SS").Delete How can I programmatically check if it already exists before deciding whether to delete or not? Currently I am looping through all the table...

Entity Framework and excel

I want to read the excel sheet file and convert to xml file. How can I do this in entity framework ...

How do I hyperlink an Excel cell to google map

"I know how to hyperlink a cell to google maps using: http://maps.google.com/?ie=UTF8&amp;ll=41.516804,-90.549316&amp;spn=1.08996,2.58728&amp;z=9 What I am try to do however is add parameters for a placemark and a label into the http:// code. So that when the map opens the placemark is at the coordinate and the is a label attached to i...

vba excel how to paste values without font/color/bg color formatting

Got a macro to copy a summary row from each of a series of worksheets. Summary row is specially formatted with font/font color/bg color, but when pasted into the 'sumamry sheet' needs to just paste values without formatting. For LoopIndex = StartIndex To EndIndex ' start in a task sheet Sheets(LoopIndex).Select CopiedCells ...

Reading excel files in vb.net leaves excel process hanging

The following code works fine but seems to leave instances of excel.exe running in the background. How do I go about closing out this sub properly? Private Sub ReadExcel(ByVal childform As Fone_Builder_Delux.frmData, ByVal FileName As String) ' In progress childform.sampleloaded = False Dim xlApp As Excel.Application ...