Excel Addin problem

whgordon44

New Member
Joined
Mar 17, 2020
Messages
5
Office Version
  1. 2021
  2. 2019
Platform
  1. Windows
Using Excel 2021 In Windows 11 the following subroutine does not work when any of the three Addin lines are uncommented. (It worked using Excel 2019 in Windows 10).

VBA Code:
Private Sub workbook_open()

    'AddIns("Analysis ToolPak").Installed = True
    'AddIns("Analysis TbutoolPak - VBA").Installed = True
    'AddIns("Solver Add-in").Installed = True

    GetData
   
End Sub

Sub GetData()

    Mypath = ActiveWorkbook.Path
   
    With ActiveSheet.QueryTables.Add(Connection:= _
       "TEXT;" & Mypath & "\daps4out.txt" _
        , Destination:=Range("A1"))
        .Name = "daps4out_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 8
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = False
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
   
End Sub
 
Last edited by a moderator:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
When posting vba code in the forum, please use the available code tags. It makes your code much easier to read/debug. My signature block below has more details. I have added the tags for you this time. 😊
 
Upvote 0
I have fixed my problem. I don't understand how but Excel was attempting to install one of my input files as an addin. I removed it from the addin list. Apparently, this extraneous was corrupting my VBA code.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

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
Back
Top