Can Checkout from workroom but not Checkin

tsil

New Member
Joined
Mar 20, 2002
Messages
39
Hi

When I run below, I get error 9 for the "Workbooks(xlsFile).CheckIn" command,
I have tried varios things but I cannot get it to work....anyone knows what is wrong ?

BR
/Tommy


Sub UseCanCheckOut()

Dim xlApp As Excel.Application
Dim wb As Workbook
Dim xlsFile As String
xlsFile = "http://workroom......../test.xls"

If Workbooks.CanCheckOut(xlsFile) = True Then
Workbooks.CheckOut xlsFile

Set xlApp = New Excel.Application
xlApp.Visible = True

Set wb = xlApp.Workbooks.Open(xlsFile, , False)
End If

If wb.CanCheckIn = True Then
Workbooks(xlsFile).CheckIn
End If
End Sub
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Does this work?
Code:
Workbooks("test.xls").CanCheckOut
 
Upvote 0
Hi

thanks for your reply, the checkout works fine alerady though, also the cancheckin,
is is the checkin that does not work.

BR
/Tommy
 
Upvote 0
Change for CheckIn then.

The idea is that you only use the filename for an open workbook, not the path and filename.
 
Upvote 0
Hi

alright, now it works :-)
I think it also was that I had forgotten the arguments to the checkin command.
Thanks for your help !

There is a small thing left though, the excel frame remains after checkin has been done.
since the workbook itself is closed....how do you close the frame from vba?
When I close it maually, I select the close option.
 
Upvote 0
Tommy

Where exactly are you running this code from?
 
Upvote 0
Hi

ah, stupid me, I forgott that I created a new excel to start up the workroom excels in,
I removed that and just opened it up in existing excel then it dissapears.

thanks a lot for your time
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top