Click here to Skip to main content
15,917,554 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am just learning how to write macro's in VB. I have 14 files posted to a SharePoint and I need to write a macro that will check out each file, refresh the file (there is a refreshall macro in each file) then check the file back in for all 14 files. I keep receiving a run-time error 9: invalid call procedure or argument when I try to run the below macro.
Any help would be greatly appreciated.
Thanks,

VB
Sub openFile()

Workbooks.Open Filename:= _
  "URL"
Worksheets("").Activate 'Destination sheet
'code to prepare print area etc

If Workbooks.CanCheckOut("") = True Then
    ActiveWorkbook.CheckOut
Else
        'code to handle error and close destination workbook
Application.Run "FY14 CR CAM Qualified Opportunity Report!refreshall"
End If
If ActiveWorkbook.CanCheckIn = True Then
    ActiveWorkbook.CheckIn
    ActiveWorkbook.Close
    MsgBox "The file has been checked in."
End If
End Sub
Posted
Updated 17-Jan-14 5:34am
v2

1 solution

9: invalid call procedure or argument when I try to run the below macro error means exactly what it says ;)

Check the documentation to find the source of error and change the code to your needs.
CanCheckOut Method[^]
CanCheckIn Method[^]
CheckIn Method[^]
CheckOut Method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900