Trying to import IQY file into current workbook.

rjtaylor

New Member
Joined
Jan 27, 2004
Messages
36
I saw this old thread Automating Importing IQY Files and used that code as well as recorded my own macro.
Here is my code.
VBA Code:
Sub Macro1()
    Workbooks.OpenDatabase Filename:="C:\New folder (2)\Data\Test2.iqy", _
        CommandText:=Array( _
        "<LIST><VIEWGUID>{9F3DD759-27BE-480E-859E-A8328E13AE80}</VIEWGUID><LISTNAME>{3C03F056-CA4D-49E4-AF32-E87160118098}</" _
        , _
        "LISTNAME><LISTWEB>https://ksn2.faa.gov/ajv/home/AJV-8/_vti_bin</LISTWEB><LISTSUBWEB></LISTSUBWEB><ROOTFOLDER>/ajv/h" _
        , "ome/AJV%2d8/Lists/Correspondence%20Tracker</ROOTFOLDER></LIST>"), _
        CommandType:=5, ImportDataAs:=xlTable
End Sub
The problem I am having is first it still brings up a prompt that the user needs to select ok on. Also it defaults to a new workbook. How do I make it import into current workbook either currnet woorksheet or by adding a new worksheet. Either is fine
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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