SOLVED

Excel help

%3CLINGO-SUB%20id%3D%22lingo-sub-1536964%22%20slang%3D%22en-US%22%3EExcel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1536964%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20excel%20community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20currently%20running%20into%20a%20small%20design%20flaw%20from%20an%20original%20project%20I%20created%20a%20few%20months%20ago.%26nbsp%3B%20Now%20I%20am%20looking%20for%20some%20advice%20on%20how%20to%20improve%20upon%20it.%26nbsp%3B%20I%20have%20these%20two%20spreadsheets%20that%20share%20information.%20Spreadsheet%20A%20is%20primary%20and%20is%20getting%20updated%20often%20%26nbsp%3Band%20Spreadsheet%20B%20is%20only%20changed%20if%20something%20has%20been%20added%2C%20removed%20or%20changed%20in%20Spreadsheet%20A.%26nbsp%3B%26nbsp%3B%20I%20am%20using%20a%20data%20connection%20in%20between%20the%20two.%20%26nbsp%3BSo%20basically%2C%20the%20process%20is%20as%20follows%3A%20users%20open%20spreadsheet%20A%2C%26nbsp%3B%20make%20the%20changes%20and%20save%20it%2C%20then%20open%20Spreadsheet%20B%20and%20wait%20for%20the%20information%20to%20populate%2C%26nbsp%3B%20close%20and%20save.%26nbsp%3B%20Then%2C%20they%20open%20Badge%20software%20and%20wait%20for%20the%20information%20to%20populate%20as%20well.%26nbsp%3B%20Things%20are%20working%20well%2C%26nbsp%3B%20but%20there%20has%20to%20be%20a%20way%20to%20cut%20down%20the%20steps.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'd%20like%20to%20figure%20out%20how%20to%20update%20Spreadsheet%20B's%20information%26nbsp%3B%20without%20having%20to%20open%20Spreadsheet%20B.%26nbsp%3B%20Is%20that%20possible%3F%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1536964%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1539600%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1539600%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F606204%22%20target%3D%22_blank%22%3E%40DougPCI%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EIf%20you%20can%20add%20a%20macro%20to%20your%20%22source%22%20spreadsheet%20(spreadsheetA.xlsx)%2C%20you%20can%20try%20the%20following%20and%20run%20it%20whenever%20you%20update%20the%20source%20spreadsheet.%20You%20can%20even%20run%20this%20on%20a%20timer%20if%20you%20want.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSTRONG%3EMacro%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3EPublic%20Sub%20refreshXLS()%3CBR%20%2F%3EPath%20%3D%20%22C%3A%5Ctest%5CExcel%5CspreadsheetB.xlsx%22%20'the%20workbook%20path%20you%20want%20to%20refresh%3C%2FP%3E%3CP%3EWith%20Application%3CBR%20%2F%3E.DisplayAlerts%20%3D%20False%3CBR%20%2F%3E.ScreenUpdating%20%3D%20False%3CBR%20%2F%3E.EnableEvents%20%3D%20False%3CBR%20%2F%3E.AskToUpdateLinks%20%3D%20False%3CBR%20%2F%3EEnd%20With%3C%2FP%3E%3CP%3EWorkbooks.Open%20Path%3CBR%20%2F%3EActiveWorkbook.UpdateLink%20Name%3A%3DActiveWorkbook.LinkSources%3CBR%20%2F%3EActiveWorkbook.Close%20True%3C%2FP%3E%3CP%3EWith%20Application%3CBR%20%2F%3E.DisplayAlerts%20%3D%20True%3CBR%20%2F%3E.ScreenUpdating%20%3D%20True%3CBR%20%2F%3E.EnableEvents%20%3D%20True%3CBR%20%2F%3E.AskToUpdateLinks%20%3D%20True%3CBR%20%2F%3EEnd%20With%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3EPublic%20Sub%20refreshXLS()%3CBR%20%2F%3EPath%20%3D%20%22C%3A%5Ctest%5CExcel%5Cdestination%22%20'the%20workbook%20path%20you%20want%20to%20refresh%3C%2FP%3E%3CP%3EWith%20Application%3CBR%20%2F%3E.DisplayAlerts%20%3D%20False%3CBR%20%2F%3E.ScreenUpdating%20%3D%20False%3CBR%20%2F%3E.EnableEvents%20%3D%20False%3CBR%20%2F%3E.AskToUpdateLinks%20%3D%20False%3CBR%20%2F%3EEnd%20With%3C%2FP%3E%3CP%3EWorkbooks.Open%20Path%3CBR%20%2F%3EActiveWorkbook.UpdateLink%20Name%3A%3DActiveWorkbook.LinkSources%3CBR%20%2F%3EActiveWorkbook.Close%20True%3C%2FP%3E%3CP%3EWith%20Application%3CBR%20%2F%3E.DisplayAlerts%20%3D%20True%3CBR%20%2F%3E.ScreenUpdating%20%3D%20True%3CBR%20%2F%3E.EnableEvents%20%3D%20True%3CBR%20%2F%3E.AskToUpdateLinks%20%3D%20True%3CBR%20%2F%3EEnd%20With%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E---%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20Macro%20is%20not%20an%20option%2C%20perhaps%20you%20could%20leave%20the%20spreadsheetB.xlsx%20open%20all%20the%20time.%20Probably%20not%20the%20the%20most%20efficient%20method%20but%20it%20will%20work.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1539819%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1539819%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F606204%22%20target%3D%22_blank%22%3E%40DougPCI%3C%2FA%3E%26nbsp%3B%2C%20you%20can%20use%20Power%20Query%20to%20pull%20the%20data%20from%20B.%20Data-%26gt%3BGet%20Data-%26gt%3BFrom%20File-%26gt%3BFrom%20Workbook.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22TheAntony_0-1595458674051.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207326i4E11B5D1510497F0%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22TheAntony_0-1595458674051.png%22%20alt%3D%22TheAntony_0-1595458674051.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1543721%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1543721%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F383224%22%20target%3D%22_blank%22%3E%40TheAntony%3C%2FA%3Eand%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F703724%22%20target%3D%22_blank%22%3EBennadeau%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBoth%20are%20good%20solution%20for%20me%20and%20thanks%20for%20the%20helps.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hey excel community,

 

I am currently running into a small design flaw from an original project I created a few months ago.  Now I am looking for some advice on how to improve upon it.  I have these two spreadsheets that share information. Spreadsheet A is primary and is getting updated often  and Spreadsheet B is only changed if something has been added, removed or changed in Spreadsheet A.   I am using a data connection in between the two.  So basically, the process is as follows: users open spreadsheet A,  make the changes and save it, then open Spreadsheet B and wait for the information to populate,  close and save.  Then, they open Badge software and wait for the information to populate as well.  Things are working well,  but there has to be a way to cut down the steps. 

 

I'd like to figure out how to update Spreadsheet B's information  without having to open Spreadsheet B.  Is that possible?  

3 Replies
best response confirmed by DougPCI (Occasional Contributor)
Solution

Hi @DougPCI,

If you can add a macro to your "source" spreadsheet (spreadsheetA.xlsx), you can try the following and run it whenever you update the source spreadsheet. You can even run this on a timer if you want.

 

Macro

Public Sub refreshXLS()
Path = "C:\test\Excel\spreadsheetB.xlsx" 'the workbook path you want to refresh

With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
.AskToUpdateLinks = False
End With

Workbooks.Open Path
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
ActiveWorkbook.Close True

With Application
.DisplayAlerts = True
.ScreenUpdating = True
.EnableEvents = True
.AskToUpdateLinks = True
End With
End Sub

Public Sub refreshXLS()
Path = "C:\test\Excel\destination" 'the workbook path you want to refresh

With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
.AskToUpdateLinks = False
End With

Workbooks.Open Path
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
ActiveWorkbook.Close True

With Application
.DisplayAlerts = True
.ScreenUpdating = True
.EnableEvents = True
.AskToUpdateLinks = True
End With
End Sub

---

 

If Macro is not an option, perhaps you could leave the spreadsheetB.xlsx open all the time. Probably not the the most efficient method but it will work.

@DougPCI , you can use Power Query to pull the data from B. Data->Get Data->From File->From Workbook.

 

TheAntony_0-1595458674051.png

 

@TheAntonyand Bennadeau

 

Both are good solution for me and thanks for the helps.