When updating a worksheet, how do I create a link updating the sa.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

A worksheet residing on my C drive is also on my company intranet. How do I
make changes to the C drive copy and have the same changes incorporated in
the intranet copy?
 
Copy the file after you have saved it?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Or copy when you save it?

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="intranet path\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord Dibben Excel MVP
 
Gord,

I meant in the windows environment :-)

Process, not automation!

Bob
 
It would be saved in the ThisWorkbook module.

With workbook open and window maximized, right-click on the Excel icon left of
"File" and select "View Code".

Paste in there.

Note: "intranet path" must be adjusted for your actual path.


Gord
 
I knew that<g>

Just offered an alternative for automation in case OP wanted it.


Gord
 
I thought you did, but sometimes it helps to spell out our thoughts for the
originators (just in case <g>).

And anyway, it's good to share a crack between old stagers (ebg>

Bob
 
Thank you so much for your help. BUT, I do have another question:
instead of saving the whole workbook to the "backup" drive, how would I just
save one worksheet of a workbook?
 
You have to copy the worksheet to a new workbook and save that

Worksheets("Sheet1").Copy
ActiveWorkbook.SaveAs Filename:="myFile.xls"

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top