-1

I need some help with this please.

I have an input workbook where product data is entered, and an output workbook(Report) where this said data is copied into a single line using vba macros.

The thing is I need to use this application on 2 different computers over the same network. I want both computers to use independent input workbooks and be able to copy the input data on a single output workbook(Report).

So in other words, I want to sync this output workbook between 2 computers so it can show me the data that both computers have entered.

Is this even possible? I'm new to this, I don't even know where to start so any suggestion or advice is welcome. Thanks in advance..

Edit: This is the code I've managed to write. Take into account that I'm new to coding lmao, I'm sure it's not perfect but it works fine.

Sub GrabarAbono()

Dim NumAnticipo As Long
Dim Fecha As Date
Dim Cedula As Long
Dim Nombre As String
Dim Total As Double
Dim UltimaFila As Long

Dim Anticipos As Range
Set Anticipos = Worksheets("Anticipo").Range("A7", Range("C6").End(xlDown))

UltimaFila = Worksheets("Reporte Ant.").Range("A" & Rows.Count).End(xlUp).Row
NumAnticipo = Worksheets("Anticipo").Range("B1").Value
Fecha = Worksheets("Anticipo").Range("B2").Value
Cedula = Worksheets("Anticipo").Range("B3").Value
Nombre = Worksheets("Anticipo").Range("B4").Value
Total = Worksheets("Anticipo").Range("C" & Rows.Count).End(xlUp).Value

'Imprimir
Worksheets("Anticipo").PrintOut Preview:=True


'Transferir Datos
Anticipos.Copy (Worksheets("Reporte Ant.").Range("E" & Rows.Count).End(xlUp).Offset(1))

Worksheets("Reporte Ant.").Activate

Range("E" & UltimaFila).Offset(1).Select

Do Until ActiveCell.Value = ""

    Worksheets("Reporte Ant.").Range("A" & Rows.Count).End(xlUp).Offset(1) = NumAnticipo
    Worksheets("Reporte Ant.").Range("B" & Rows.Count).End(xlUp).Offset(1) = Fecha
    Worksheets("Reporte Ant.").Range("C" & Rows.Count).End(xlUp).Offset(1) = Cedula
    Worksheets("Reporte Ant.").Range("D" & Rows.Count).End(xlUp).Offset(1) = Nombre
    ActiveCell.Offset(1).Select
Loop

'Protect
Worksheets("Anticipo").Protect 
End Sub
  • Please show the code for the existing vba macro that is working for your one input workbook. – Rey Juna Aug 16 '18 at 1:59
  • Is this even possible? In general, this is impossible. Imagine - the file is opened and corrected at both stations simultaneously. The station which save its work later will kill all changes inserted by a station saved its work earlier. – Akina Aug 16 '18 at 4:45
0

To use independent input workbooks and be able to copy the input data on a single output workbook(Report) over the same Network do the following:

Option 1:

  • Make the Folder Sharable & store the INPUT Workbook there.
  • Edit your VB code and add this line to open the WB.

Workbooks.Open Filename:="DriveLetter:\Path\Filename.xlsm"

  • This code must be followed by rest of the procedural lines.

Option 2:

Create this Macro & store as standard Module:

Private Sub RunfromServer()

Dim wb As Workbook
Dim MyFile As String
Dim MyPath As String
MyPath = MyPath = "\\MYServer\ShareFolder\My Folder\"

MyFile = Dir("Filename.Xlsm")


Do While MyFile <> ""
Set wb = Workbooks.Open(MyPath & MyFile)


*Your code here*


  wb.Close SaveChanges:=True
  MyFile = Dir
Loop

 End Sub
  • Make as many copies you need of your VBA(Macro) & Run it from different computers.
  • Glad to help you @Christian,, keep asking. ☺ – Rajesh S Aug 17 '18 at 6:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.