excel

XL VBA - Passing an array in a user defined function?

How to pass an array as a parameter for a user defined function in MS Excel VBA? Eventually I want to test that if a given date (dateDay) is in several ranges of dates (arrayVacation): Function CB_IsInRangeArr(dateDay As Date, ParamArray arrayVacation() As Variant) As Boolean ' Test that the array is in the form of 2 columns and n...

Pear Excel Writer: trimming leading zeros - how to prevent?

I'm using the Pear Excel Writer package to export a dataset to Excel from PHP. My problem is some of the data fields have leading zeros (such as a zip code), but these are being trimmed in Excel. I tried adding an apostrophe to the start of the fields to force a text field, but then Excel displays it, which I don't want. I'm neither a PH...

problems with excel's application.evaluate command in vba

Hi guys, I have a problem with some excel code that I am having trouble getting my head around. Okay so I am using the application.evaluate command in excel vba, office 2007. If i have Evaluate("SIN(45)") it returns a nice predicted number. However if I do Evaluate("eq") the code crashes. eq is an equation i am reading in from excel....

Excel Com Interop ASP.Net Cannot write file to disk. Permissions?

I've got a pretty simple web form which lets users pick reports, one specific report they want in xls with pretty formatting instead of CSV. I've whipped up the report using COM INTEROP with excel 2007. It works on my local machine and can write the file, but on the web server it fails with this error: Microsoft Office Excel cannot op...

Most Efficent Way to Add Formatting Excel - VBA

I have a macro that add hundreds of lines of data to an excel spreadsheet. I call a procedure from a loop which inserts each line of data. I have been applying the formatting for the row each time that I insert that data. However, during my testing I have found that I can insert all of the data about 3/4 of second faster (3.3 sec vs. ...

Export MS Access tables through VBA to an excel spreadsheet in same directory

I have two tables in my access database that I want to be able to export to excel. I can do it by opening the table and then doing File->Export... and then choosing the format and typing in the file name. However, this way the user actually has to type the name in so there is room for misnaming the file or for saving it as the wrong for...

SpreadsheetGear fonts look blurred compared to Excel

I'm evaluating the SpreadsheetGear component for Excel file manipulation. However, out of the box the fonts look slightly blurred or hazy when the same spreadsheet is viewed side-by-side with Excel. Is there some anti-aliasing setting I'm missing? Or is this by design? ...

[Excel] Populate list via a bi-Condition

Hello excel-world, im interested to implement something but im not sure if it would be possible and would like your intake on it. here is my scenario: i will have two validation cells which will be shown as List that I will pick from. those are my condition that i would like to meet and ommit my list from a database. I have a list of...

import excel to sql db table

I am trying to write data from an excel spread sheet to a SQL Database. I have been able to connect to the Excel Spreadsheet and read the data but I am unable to get the data to insert into the SQL DB table. the current code is as follows any help most appreciated. Dim plmExcelCon As System.Data.OleDb.OleDbConnection Dim ldEx...

what is next cell column in Excel - combinations/permutations

I need to know column name of a spread sheet with a given starting colum upto n number of columns let say starting column is "AB", I want to know the column (label) after 99 columns. For those who need Ralph answer in T-SQL flavor Create FUNCTION fsExcelValueToColum(@value int) returns varchar(3) as begin DECLARE @DIGIT INT,@RV VARCHA...

How do I return the location of the marching ants in Excel?

I know about Application.CutCopyMode, but that only returns the state of the CutCopyMode (False, xlCopy, or xlCut). How do I return the address of the currently copied range in Excel using VBA? I don't need the currently selected range (which is Application.Selection.Address). I need the address of the range of cells with the moving bor...

A couple of questions about Word macros

I need to grab a list of names from Excel and insert them into a Word document, printing one document per name. The document has some text and a bookmark called "name". The code is below. First, I want to know if it's possible to detect how long is the list of names in the Excel spreadsheet and grab that, instead of hardcoding the numbe...

VBA Columns Automatically Merge?

I am writing a program in VBA that first compiles a Range from a series of cells and then later loops through the range to collect the data in the cells. The problem is that I need the range to maintain the order in which I add the cells so that I can then collect the data in the correct order when I go back through. If the data are in...

Excel Formula Null Value

I am using Excel to create some formuals to calculate a total dollar ammount (profit). At the moment there will be multiple rows that will calculate profit based on the amount of profit from the number above it. So say that Day 1 there is $1000 and that make 5% profit. Day 2 there is $1005 and that make 3% profit, Day 3 etc. Compoundin...

hyperlinks in phpmyadmin

Hello guys, I have an excel spreadsheet, with one of the columns in form of hyperlinks which when clicked opens a particular web page which is not stored on my computer. How do I import these hyperlinks into phpMyAdmin and make them clickable? The import function creates text which is not clickable. Thanks! ...

Any way to determine when Excel background printing has finished?

I'm using COM in LotusScript (Lotus Notes) to make Excel print several sheets in one workbook to PDFCreator, then make PDFCreator combine then into one PDF. The problem is that calling Excel's PrintOut method immediately followed by PDFCreator's cCombineAll method results in one or more sheets being omitted from the PDF. It seems like Ex...

Convert XLS to CSV on command line

How could I convert an XLS file to a CSV file on the windows command line. The machine has Microsoft Office 2000 installed. I'm open to installing OpenOffice if it's not possible using Microsoft Office. ...

Apache POI - error in reading excel file

I am using poi-3.5-beta5 to read excel file. I am trying to open excel file through XSSFWorkbook workBook = new XSSFWorkbook (xlsPath); i am getting following error (although i am not using log4j) Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger at org.apache.poi.openxml4j.opc.Package.(Package.java:...

.Net Regex to parse Excel header / footer strings

I am trying to create a .Net Regex that will separate an Excel header data string into its component parts. The following example shows the format of the raw data string I need to parse: &LLeft-side text&CCenter text&RRight-side text The tags &L, &C and &R respectively demark the left, center and right sections of the header data. So,...

PHPExcel - Formatting gets lost when editing from code

Hi all, I'm playing around with an PHP - MS Excel integration these days. My task is to open an existing spreadsheet, add some data and save the filled spreadsheet as a new file. Basically sort of a template filling engine, eventhough xlsx files are used as templates. I looked into PHPExcel which seems to be fairly nice framework. In o...