worksheet

C#: Getting the number of rows/columns with ExcelPackage

£可爱£侵袭症+ 提交于 2019-12-04 15:01:54
问题 I need to read and write data from an Excel spreadsheet. Is there a method to finding out how many rows/columns a certain worksheet has using ExcelPackage? I have the following code: FileInfo newFile = new FileInfo(@"C:\example.xlsx"); using (ExcelPackage xlPackage = new ExcelPackage(newFile)) { ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[1]; } I need to iterate through each cell this worksheet has and spit it into a fairly big table, but I don't want to print out blank cells or

Convert all “Worksheet Objects” to images in powerpoint

瘦欲@ 提交于 2019-12-04 09:41:07
问题 Really not sure what stack site to place this on. Feel free to move it to the correct one. My question isn't really related to programming, but I have a ton of power points with these "Worksheet Objects" embedded in the slides. Some appear to be graphs from excel as well as other chart type items from Visio. I need to convert all these "Worksheet Objects" to just images within the slide. My process right now is copy the object > Paste as Image > Move to the correct location > Delete the

calling excel worksheet function from excel cell

我的未来我决定 提交于 2019-12-04 07:42:49
I have a set of user defined vba functions that sit in an excel module, which are then called from an excel spreadsheet... everything has worked fine at this point. I've been asked to move the vba from the module to the worksheet's code page. When I did this, I've found I can't call any of the functions from cells on the worksheet... the names simply don't show as existing. Is there a way to call worksheet functions from an excel cell? Also, is there any problem calling a worksheet function from a user defined function in another module or worksheet code behind? EDIT: I've found if I call by

Protect Excel Worksheet For Read Only But Enable External Data Refresh

别来无恙 提交于 2019-12-04 07:19:19
I have an Excel 2010 workbook. One worksheet imports data from an external data connection (SQL query). I have also added additional columns to the worksheet to perform calculations on the data and to massage it a bit. The worksheet forms the backbone of the raw data used in the other worksheets. I'd like to protect the worksheet to make it read-only (allowing sort, filter, pivot table usage). I know how to do this with the protect worksheet feature. But when the worksheet is protected, I can't use the Refresh button to refresh the data from the source and I want users to be able to do this. I

Excel calculate increase in value every 200ms

[亡魂溺海] 提交于 2019-12-04 05:10:40
问题 I have this worksheet which gets data from API and its refreshes itself every 200 milliseconds. I want to calculate the change in value which is constantly increasing every 200 ms. For example Cell B2 has a value of 4 after 200 ms its changes to 7 then to 16 then to 26 etc, it just keeps adding value into it. All I want is to subtract the old value from the latest value to get the change for example 7-4=3 or 16-7=9 or 26-16=10. I have added an image for clarification. This shows how I'm

Copying specific columns conditionally to another worksheet

两盒软妹~` 提交于 2019-12-03 23:18:08
The example i have below will copy specific rows from worksheet 1 to worksheet 2 if "YES" is found in column E. I need it to only copy specific columns of the rows, being B & C. Fund Account Amount Gain/Loss As/Of? (Y/N) 1 11111 $15,000.00 -$1.51 YES 1 22222 $32,158.52 $78.14 YES 2 123123 $1.00 $0.00 NO Code: Sub As_Of_Analysis_Sorting() Dim lr As Long, lr2 As Long, r As Long lr = Sheets("All Trades").Cells(Rows.Count, "A").End(xlUp).Row lr2 = Sheets("As-Of Trades").Cells(Rows.Count, "A").End(xlUp).Row For r = lr To 2 Step -1 If Range("E" & r).Value = "YES" Then Rows(r).Copy Destination:

Looping through worksheets with PHPExcel

不打扰是莪最后的温柔 提交于 2019-12-03 11:12:29
问题 I'm using the PHPExcel library to read an Excel file and perform processing on it. I want to loop through each worksheet. I checked the documentation and all I could find was changing the active worksheet index or only loading specified worksheets. How can I loop through all worksheets? Thank you for any help. Here is the documentation's looping example, for reference: <?php $objReader = PHPExcel_IOFactory::createReader('Excel2007'); $objReader->setReadDataOnly(true); $objPHPExcel =

C#: Getting the number of rows/columns with ExcelPackage

♀尐吖头ヾ 提交于 2019-12-03 10:23:25
I need to read and write data from an Excel spreadsheet. Is there a method to finding out how many rows/columns a certain worksheet has using ExcelPackage? I have the following code: FileInfo newFile = new FileInfo(@"C:\example.xlsx"); using (ExcelPackage xlPackage = new ExcelPackage(newFile)) { ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[1]; } I need to iterate through each cell this worksheet has and spit it into a fairly big table, but I don't want to print out blank cells or get an exception. Is there a method resembling worksheet.rowNum or colNum ? You can get the row and

Copying Excel Worksheets in POI

对着背影说爱祢 提交于 2019-12-03 09:45:55
Does anyone know of a means to copy a worksheet from one workbook to another using POI? The Workbook class has a cloneSheet method, but there doesn't seem to be able to insert a cloned sheet into a new workbook? If there isn't an API to do this easily, does anyone have the code to copy all of the data (styles, column widths, data, etc) from one sheet to another? The jxls has methods to copy sheets, but they don't work when copying between workbooks. Leninkumar Koppoju i have implemented some functionality with poi. please see the code for your reference. import java.io.BufferedInputStream;

Reference excel worksheet by name?

∥☆過路亽.° 提交于 2019-12-03 08:37:29
问题 I have the name of a worksheet stored as a string in a variable. How do I perform some operation on this worksheet? I though I would do something like this: nameOfWorkSheet = "test" ActiveWorkbook.Worksheets(nameOfWorkSheet).someOperation() How do I get this done? 回答1: There are several options, including using the method you demonstrate, With, and using a variable. My preference is option 4 below: Dim a variable of type Worksheet and store the worksheet and call the methods on the variable