Formula with Link not working in VBA

woodsy74

New Member
Joined
Jun 29, 2012
Messages
20
I have a formula in my excel file that links to a CSV file. When I manually open up the CSV file the excel formula updates correctly. And, if I look at the formula with the CSV file open the formula only lists out the CSV file name and when I look at the formula with the CSV file not open then the formula lists out the entire file path.

When I open up the CSV file using VBA code the formula does not update. When I view the formula it still lists out the entire file path even though the CSV file is open. I am using Workbooks.Open to get the CSV opened. I was previously doing this to copy a bunch of data into the excel file and that was working. Trying to go with the link because the amount of data to copy over is getting much larger and the formula gets the one piece of info that I need.

Any thoughts on why the link formula doesn't work when the file is opened via VBA? Let me know if you have any questions or need any other information. Thanks.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Either your main Excel file and the csv execute in two separate session of the Excel, or the file you open is not the one linked, for example the same name of file but from two different directories (not to mention two slightly different names of file)
Can you set a link from the main Excel file to the csv, when the csv is open via Workbooks.Open? If Yes, which is the formula shown after closing the csv?
 
Upvote 0
Either your main Excel file and the csv execute in two separate session of the Excel, or the file you open is not the one linked, for example the same name of file but from two different directories (not to mention two slightly different names of file)
Can you set a link from the main Excel file to the csv, when the csv is open via Workbooks.Open? If Yes, which is the formula shown after closing the csv?
Thank you! The formula I originally wrote was using the mapped network drive letter. When the code opened up the file the mapped drive letter wasn't showing. I changed the formula to use the full network drive name and it now seems to be working. Thanks again.
 
Upvote 0
Solution

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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