ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Overwrite Open Excel files on Macro (https://www.excelbanter.com/excel-programming/426880-overwrite-open-excel-files-macro.html)

instereo911

Overwrite Open Excel files on Macro
 
Good morning,

I have a macro that goes out to an excel document on a Windows Sharepoint
site and updates a bunch of cells then after updating it is supposed to save.

The problem is if someone has the document open, i can save it. It gives me
an error. Is there a way of telling the macro... "No matter if someone has it
open, update the cells and save the document"

Here is part of the code

Workbooks.Open "http://Sharepoint.auth.testing/Host.xls"
Sheets("Detail").Select
Application.Goto Reference:="Query_from_MS_Access_Database"
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("West Host Inventory Total").Select
Range("A1").Select
ActiveWorkbook.SaveAs Filename:= _
"http://Sharepoint.auth.testing/Host.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close

Thanks everyone... and hopefully ou can help me fix this junk of a problem :)

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200904/1



All times are GMT +1. The time now is 10:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com