We help IT Professionals succeed at work.
Get Started

How can I autosave to a sharepoint file using a excel macro when saving workbook to normal location.

204 Views
Last Modified: 2020-01-31
Hi

I run excel 2016 on a server and im trying to autorun a macro when the save button is clicked on the workbook I have open or if easier run it when workbook closed.

I need it to save the workbook thats open as normal to location it is at and also run the following macro in the background so people dont have to save twice.

 ActiveWorkbook.SaveAs Filename:= _
        "xxxs://arrivagroup.sharepoint.com/teams/PASSACC/Shared%20Documents/General/Cubic%20TVM/OLD%20LENNON%20DATA/loomis%20bag%20order99.xlsm" _
        , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub

What im also trying to do is when it saves it to the sharepoint there will already be a file with the same name in it and so I need it overwritten with new file it saving,.

I have had a look at doing it via  autosave into one drive but this dont work.

Any Ideas?
Comment
Watch Question
Mechanical Engineer
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013
Commented:
This problem has been solved!
Unlock 2 Answers and 10 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE