If Workbooks.CanCheckOut(xlFile) = True Then
Workbooks.CheckOut xlFile
'...code here does stuff
'Save Workbook
ActiveWorkbook.Save
'Check In Workbook back to sharepoint
ActiveWorkbook.CheckIn
Else
MsgBox ("The file is currently in use. You are unable to check out this document at this time...
I have the code which checks if the file has been checked out on Sharepoint. Is there anyway of finding out who has the file checked out using VBA (Excel).
Thanks
How do I do this between seperate workbooks?
At the moment the code does the copy, opens the new workbook, sets where to paste but doesn't paste.
The paste range in the new workbook is alway dynamic by selecting the next available cell
So I cant set a fixed range of the new workbook to paste.
I have the following code so far. From one workbook, I have it opening another workbook from sharepoint. this works fine.
I am trying to copy data from the original workbook into the opened sharepoint file, however I am getting the error 'PasteSpecial method of Range class failed' on the line...
All my content will be stored in the following range:
Range("S5:AD49")
I have the following code which takes the formulas from the first column and paste them into the next column, then copies the values in the first column and pastes over themselves.
Range("S5:S49").Select
Selection.Copy...
I have the following code which works perfectly copying all sheets in current workbook to a new workbook. How do I modify so I can choose specific sheets not to copy. Can I use a range with sheetnames?
Sub CreateUKPBFile()
'Change segment selection to UKPB
Range("D3").Value = "UKPB"
Dim...
Would it?
I thought if the beginvaldate was 31/10/2014 and the months accrued was say 3, then it would only select records the previous 3 months records up until the 31/10/2014. How/why would it select more than 3 months?
I managed to get it working by using the following sql code:
SELECT tblBeginEndVals.Sedol, CLng([ParentID]) AS PID, tblIssuerParentMap.ParentID, tblStocks.IssuerName, tblStocks.Description, tblBeginEndVals.ClientCode, tblBeginEndVals.ProductCode, tblBeginEndVals.BeginValDate AS TestDate...
Here is the SQL for the query:
SELECT tblBeginEndVals.Sedol, CLng([ParentID]) AS PID, tblIssuerParentMap.ParentID, tblStocks.IssuerName, tblStocks.Description, tblBeginEndVals.ClientCode, tblBeginEndVals.ProductCode, tblBeginEndVals.BeginValDate, tblBeginEndVals.YYYYMM...
I have a query which retrieves a year's worth of data. In one of the fields I have a number which specifies how many month's a client has accrued.
So Client A may have accrued the last 3 months. So I only want to retrieve the last 3 months for him.
Client B may have accrued the last 6 months...
Both options work in the fact the error dissappears however jbenseon your code doesnt pull through the value stored in the database if there is a value. any ideas?
I have a range of textboxes and dropdown lists on my page. On the load event I am populating to these controls with a record from a table in the database.
I have a field called AgeRange. I want to display the value in the field as the selected item of a dropdownlist. Then they can change if...
I managed to get it working, however it works when the column number of the second index statement is 1. If I choose 2, 3 or any other number I get VALUE error.
Is this something to do with the data in column 2?
I am trying to sum across rows and columns
Section Jan 13 Feb 13 Mar 14
A 10 10 10
A 10 10 10
B 5 5 5
What I am trying to do is sum everying up until today for each section
I have the following code which is importing data from XML fine but only for the parent node.
Dim Mapping1 As New SqlBulkCopyColumnMapping("submission-reference", "SubmissionRef")
Dim Mapping2 As New SqlBulkCopyColumnMapping("created-at", "DateCreated")
Dim Mapping3 As New...
Getting the error Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Here is my code:
Protected Sub gvHosts_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)
If e.CommandName =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.