Combining Information from Multiple Workbooks - Data Link Properties Error

Jimdandy527

New Member
Joined
Oct 3, 2013
Messages
9
I am seriously stuck!

I have several workbooks within a given folder. The code below has worked without issue in the past, so I need help with troubleshooting whatever apparently changed. The problem seems to be that in the process of opening and closing the various workbooks, there is a data link properties box that pops up. I have never seen this before and if I cancel out it, I receive a run time 1004 error. The line that bugs out is in bold below.

Please point me in the right direction. Many Thanks - john

Code:
Sub MergeBooks()Dim booklist As Workbook
Dim mergeobj As Object, dirobject As Object, filesobj As Object, everyobj As Object
Application.ScreenUpdating = False
Set mergeobj = CreateObject("scripting.filesystemobject")


Set dirobj = mergeobj.getfolder("C:\Documents and Settings\User\Desktop\AMMENDED MAY")
Set filesobj = dirobj.Files
For Each everyobj In filesobj
[B]Set booklist = Workbooks.Open(everyobj)[/B]
booklist.Sheets(1).Select
Call Module1.UnProtect1
Range("D215").Value = 1
Call Module1.Format1
Call Module1.Format2
Call Module1.UnlockUnhide
Call Module1.Protect1


Range("D1:BA1" & Range("A65536").End(xlUp).Row).Copy


ThisWorkbook.Worksheets(1).Activate


Range("D65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAll






Application.CutCopyMode = False
booklist.Close
Next


Call MergeBooks1
Call MergeBooks2
Columns("BB:BC").Select
    With Selection.Font
        .ThemeColor = xlThemeColorDark1
        .TintAndShade = 0
    End With
    Selection.EntireColumn.Hidden = True
Call DeleteEmptyRows
Call Module1.Format3


Call MergeBooksVisual
Call MergeBooksBreakers
Call MergeBooksXfmrStatus
Call MergeBooksXfmrMeter
Call ProtectBooks
Range("A1").Select


End Sub
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,598
Messages
5,832,646
Members
430,150
Latest member
amitk1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top