excel-2007

Embed object in Excel programmatically

别说谁变了你拦得住时间么 提交于 2019-12-14 00:33:35
问题 I've tried several libraries, including EPPlus, NPOI and they can insert images, but i couldn't find how to insert objects( pdf's, text files, images ) as files . Is there any way or library to do that in .NET? Thanks! 回答1: Using this code I was able to embed a PDF file, a txt file , and a png file into Excel using C#. public static class ExcelReaderFunctions { public static void ExcelInsertOLE(string path) { Microsoft.Office.Interop.Excel.Application excel = new Application(); excel

“Transposing” some columns with ID fields into rows while copying the other data

我怕爱的太早我们不能终老 提交于 2019-12-13 21:44:42
问题 Suppose I inherited a table in Excel that dealt with processes and individuals, which (among thousands of other rows) looks similar to this. ID | Name | Quality1 | Quality2 | ... | QualityN | ... 234,014,828,423 James Low Hot . Blue 212,552,211 Mark Low Cold . Red 845 Amy High Hot . White ... I intend to use this data in Access later, as a reference table where each ID number is distinct and has data to go along with it. The first step is obviously to use the text to column tool in Excel to

Sending emails from Excel using Outlook without security warning

别等时光非礼了梦想. 提交于 2019-12-13 21:21:35
问题 I am using code from Ron de Bruin's website to send emails through Excel using Outlook. I get this security warning "A program is trying to send e-mail message on your behalf" asking me to allow or deny. How can I avoid this warning and send emails directly" Note: I am using Excel 2007. Here is the code: Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim cell As Range Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) Sheets("" & Sheet & "")

Problem updating record in Access 2007 database from Excel Worksheet

若如初见. 提交于 2019-12-13 20:17:43
问题 I have a macro in my excel workbook that updates a specific record in the access database related to the spreadsheet. All works fine if the access database is closed. Problems arise if the database is open and a user is editing the specific record that the excel spreadsheet relates to.` I get the following Error Message: Error Number 2147467259: The database has been paced in a state by user 'ADMIN' on 'LAPTOP' that prevents it from being opened or locked. I have set the database form's

De-Stacking columns in Excel using VBA

大兔子大兔子 提交于 2019-12-13 19:53:09
问题 I have a dataset in three columns composed of a repeating set of UUIDs in the first column, string responses for each UUID in the second, and a code for each response in the third. I need to break this out into multiple sets of columns, one for each repeating set of UUIDs. See the below illustration: I Have: UUID RESPONSE Resp. Code id1 String1 Code1 id2 String2 Code7 id3 String3 Code3 id1 String4 Code3 id2 String5 Code5 id3 String6 Code1 I need: UUID RESPONSE Resp. Code RESPONSE Resp. Code

Delete the string after the delimiter in excel

一世执手 提交于 2019-12-13 19:41:36
问题 I have simple problem. I was analyzing some data and came up with this problem. Below is my value in a colomn: www.mysite.come/api/Customer?id=12333&name=jack www.mysite.come/api/Department?id=52365&name=COP www.mysite.come/api/Customer?id=13333&name=mathew etc I want to filter this data something like this www.mysite.come/api/Customer www.mysite.come/api/Department www.mysite.come/api/Customer Please help me with this. 回答1: If its just as simple as removing everything after, including, the ?

Import and Run Macro from text file

巧了我就是萌 提交于 2019-12-13 18:32:45
问题 I'm trying to simply import a test macro into my current Excel Workbook. And then run the macro. I'm on Excel 2007. I'm getting the error: Run-time error '1004': Cannot run the macro 'DoKbTest'. The macro may not be available in this workbook or all macros may be disabled. If I change one line of code to say: Set oBook = oExcel.Workbooks.Add it works fine. Why does it fail when I refer to ThisWorkbook? Here's the code: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As

How to find data between two dates

痴心易碎 提交于 2019-12-13 18:15:59
问题 I do not use Excel regularly, hence I am unfamiliar with complicated formulas. I have an Excel 2007 sheet like this: A B C Name leavefrom leaveupto Mathew 07-Mar-13 25-Mar-13 john 12-Mar-13 15-Mar-13 kerry 18-Apr-13 25-Apr-13 Mikes 27-Jun-13 03-Jul-13 and I have a cell C10 where I am providing a date value. If I am providing 14-mar-13 then it should show the name "john" and "Mathew", if I provide 19-Apr-13 it should show "kerry", etc... Basically, if I provide a date value it should find the

How do I delete all characters after the first space in a cell?

独自空忆成欢 提交于 2019-12-13 15:12:31
问题 I have a list of city names followed by the state in which they are located all in one column in Excel. How can I delete everything after the first space so that the city name is the only thing that's left in the cell? example: A1 = "johnson TX" should be just A1= "johnson" 回答1: I assume you want a VBA solution since you tagged your question excel-vba. This works: Sub KeepCity() Dim strCityAndState As String Dim strCityOnly As String strCityAndState = Range("A1").Value strCityOnly = Left

How do I group a set of shapes programmatically in excel 2007 vba?

混江龙づ霸主 提交于 2019-12-13 12:07:49
问题 I am iterating over data on the Electrical Tables sheet and creating shapes on a Shape sheet. Once the shapes are created I would like to programmatically group them. However I can't figure out the right syntax. The shapes are there, selected, and if I click the group button, they group perfectly. However with the following code I get Runtime Error 438 Object does not support this method or property. I am basing this code on vba examples off the web - I am not a strong vba programmer. What is