excel

How to open a macro enabled Excel file on a SharePoint in edit mode from an Excel vba?

岁酱吖の 提交于 2021-01-29 15:23:57
问题 I have an macro enabled Excel file on a SharePoint that when a user opens it from the SharePoint the file opens programmatically another macro enabled Excel file on the same SharePoint. The file being opened by the vba macro needs to be edited, and must be editable by multiple users at the same time. However I can't get it to even open in edit mode. Using Office 365 I've tried << ActiveWorkbook.LockServerFile >> but always get an error message << Run-time error 1004: Method 'LockServer' of

Calls to lstrlenA or lstrlenW are returning unexpected values

别来无恙 提交于 2021-01-29 15:21:45
问题 Summary: In Excel VBA, I've got a function that gets CF_TEXT from the clipboard, and another function for CF_UNICODETEXT. I use lstrlenA / lstrlenW to get the length of the string, but I'm getting unexpected results from those calls. I'd like help to understand why. Details: Within my functions, I use CopyMemory after opening the clipboard to get a byte array that I can then turn into a string. I'm in the process of adapting the project for 64-bit Office, and wanted to make sure everything

Function to calcuute future values =)

若如初见. 提交于 2021-01-29 15:14:53
问题 guys, need help with my function, just one moment...if "Range" is null (Cell have value "") then ignore it, because i have alredy done it to count i dont know how to change for ignoring such cells. Thank you Public Function future (ByVal r1 As Range, ByVal r2 As Range, ByVal r3 As Byte) As Variant On Error GoTo errHandler If (r1.Columns.Count <> r2.Columns.Count Or r1.Rows.Count <> 1 Or r2.Rows.Count <> 1) Then future = "ERROR!""" Exit Function End If Dim denominatorSum As Double Dim

Compress all the pictures to email size pixel (96)PPI by using command button

柔情痞子 提交于 2021-01-29 15:13:48
问题 I want to compress all the pictures in excel workbook to email size pixel 96( ppi) by using command button with the following code. But it doesn't work to compress all pictures .It can only compress 1 picture. Sub test() Dim wsh As Worksheet Set wsh = Worksheets("Sheet1") wsh.Activate wsh.Shapes(1).Select SendKeys "%e", True SendKeys "~", True Application.CommandBars.ExecuteMso "PicturesCompress" End Sub 回答1: Try using a For Each loop to iterate through all shapes in the worksheet: Sub test()

Adapting existing excel function to find a match in a different column and remove digits

半世苍凉 提交于 2021-01-29 15:08:51
问题 I have the following example data set in excel. Currently, for reference, John,Smith is in A4 and Smith Johnson is in B4. Column 1 = Names of Members Column 2 = Attended (list of members that attended a meeting). Applied to column 1, I would like to add a function that turns GREEN any members that are in column 2 (attended) that are also in column 1. Like so: The solution used in the end was to use this formula, which does the trick: =SUMPRODUCT(--(MID($A4&" "&$A4,FIND(",",$A4)+2,FIND(",",$A4

MS-Access or Excel: Convert data from rows to columns, in unknown range of columns

非 Y 不嫁゛ 提交于 2021-01-29 14:58:05
问题 I have a table like this: **customer_id product_id** 1 1234 1 1125 1 6528 2 5645 2 5528 3 4565 And I want to make a query that will give the same information, where each consumer will have one row, and each product_id will be in a separate column, when I do not know how many columns are needed, because each consumer has made a different amount of purchases, This is the result I want: **customer_id First_product Second_product Third_product ** 1 1234 1125 6528 2 5645 5528 3 4565 Note this: How

Import Array list to excel format with out using for loop in C#

跟風遠走 提交于 2021-01-29 14:50:39
问题 E.g. I have huge number of data in my list, I done it using for loop. But taking more time to import the data into excel. I tried below code with out using for loop. But i'm getting below error in range.set_Value. Error:An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll Additional information: Exception from HRESULT: 0x800A03EC List<myobj> NGDetailsList = new List<myobj>(); NGDetailsList.Add(new myobj { name = "AAA", designation = "test" });

VBA Excel save .xlsx file with the flexible name

你。 提交于 2021-01-29 14:41:45
问题 I would like to save my file with the flexible name, which will change as the cell value changes. The one answer is here: Save a file with a name that corresponds to a cell value however, I want also some fixed part of the name, which won't change unlike the part described in the query above. Basing on this solution I tried to write something as follows: Sub Save () Dim name As String, Custom_Name As String name = Range("A2").Value Custom_Name = "NBU" & name & "- Opportunity list.xlsx"

How to add Open Workbook to “Application.Workbooks” collection and/or interact with Workbook

北慕城南 提交于 2021-01-29 14:30:16
问题 I have a macro which runs from wb=ThisWorkbook . It opens up Internet Explorer and retrieves another WB which automatically opens. I'm trying to copy the sheet from that WB to ThisWorkbook , but it doesn't appear the "automatically opened" wb's are included in "Application.Workbooks". Can I force an update to "Application.Workbooks" or hack around this limitation somehow? More Details: My macro opens IE, finds a button and presses it which automatically opens a separate instance of Excel

Onclick the button to export excel in XPages

家住魔仙堡 提交于 2021-01-29 14:25:07
问题 I found the code on the website: https://www.xpagedomino.com/2015/02/xpage-export-to-excel-using-javascript.html Now I have : a view one button I want to use the button to export the excel. The following is I already tried the code: In the button(Client-side) : var viewPanel1Id = "view:_id1:viewPanel1" var htmltable = document.getElementById(viewPanel1Id); var html = htmltable.outerHTML; window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html)); But the button was no response..