• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Unable to close source and target files post data copy from excel to text file

Ashutoshiacr

New Member
Hi All,

I am a beginner in VB field. I have a requirement to copy data of three sheets of an excel workbook, paste it into a text file and save it as a tab delimited text file. I am able to achieve my requirement but the only thing is that the source excel file and newly created text file are not closing automatically. sample file and code attached. Please help me on this.
 

Attachments

  • Merge.xlsm
    13.7 KB · Views: 2
  • Source.xlsx
    10.9 KB · Views: 2
Hi Narayan,

Thanks a lot for your time. This seems to be working in my local machine but not in client's machine(virtual machine). File remains open after processing as well and pop up for saving. Please let me know whether there is any excel level setting is required for the same. Client's machine has excel 2010 where as mine has 2013.

Thanks,

Ashutosh
 
Hi ,

I have tried it on my computer which has Excel 2010.

Has the path name been set correctly ?

If the statement :

Application.DisplayAlerts = False

works , then there should not be any pop-up alerts.

Narayan
 
Hi Narayan,

The path is pointing to a remote server with syntax like '\\remoteservername\username$\data\Test\data\'. Please let me know if somethings needs to be done for this as well.

Thanks,

Ashutosh
 
Hi ,

Basically the VBA variable PATHNAME should be set to the correct pathname where the Source.xlsx workbook exists , and where the text file will be saved.

The user should have write permission on the folder so that the file save happens.

Narayan
 
Back
Top