Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 01-25-2019, 09:50 PM
Kenneth Hobson Kenneth Hobson is offline Changing Absolute path to Relative in a Macro Windows 10 Changing Absolute path to Relative in a Macro Office 2016
Advanced Beginner
 
Join Date: Jun 2018
Posts: 37
Kenneth Hobson is on a distinguished road
Default

I did some testing but since I had knee surgery today, I was not able to finish it.

The yellow error is due to maybe running it before? Simply delete the Data > Query and Connection and the ListObject. I select all the sheet and Clear for ListObject.

For the extra sheet, that is due to ActiveWorkbook.Workbooks.Add. Comment out or delete that line.

The last thing is getting the f string right. I worked a bit on it but more is needed. I don't like the long string used in the recorder. If Structured right, you can see more easily how to fix it and see what it does. In the Query, it will error. Open the Query dialog to give you clues to debugging.

Since you are adding to the ActiveSheet, why not do the Data > for worksheets import rather than ActiveWorkbook? The sheet method does not have the explicit data types so your formula string will just include and array of integer data types rather than explicit one. The field/column names is shorter too.

I most test code. On one computer it worked fine. On this other, it is showing some issues that you ran into.

I will have a solution for you tomorrow if you have not tweaked it to work fully by then.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Absolute path to Relative in a Macro Relative path for hyperlinks wpryan Word 4 01-09-2019 05:15 PM
Changing Absolute path to Relative in a Macro Image absolute position relative to page thuizt Word VBA 4 08-01-2017 07:25 AM
Hyperlinks defaulting to absolute instead of relative!!! wdzambotti Word VBA 1 08-17-2015 09:03 PM
Changing Absolute path to Relative in a Macro PowerPoint VBA: ApplyTemplate & absolute path tinfanide PowerPoint 2 04-05-2013 07:28 AM
Changing Absolute path to Relative in a Macro Relative path to desktop b0x4it Word VBA 4 05-18-2011 11:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft