Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8323211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:39:14+00:00 2026-06-08T23:39:14+00:00

I try to create a macro for excel which reads the content of a

  • 0

I try to create a macro for excel which reads the content of a text file, creates a new workbook of it and than uses a specific section inside the created workbook. To be able to get easy access to needed columns, I worked with Workbook.OpenText. But instead of inserting a fix path to my file, i would like to get the path of the file I copied to the clipboard. My Problem is, I don’t know how to get access to the clipboard of windows. I found a tutorial on working with the clipboard here, but i can’t get access to the expected library. I also searched also on my computer for a file called FM20.DLL like explained in this forum but couldn’t find anything.
Here is my code:

Workbooks.OpenText Filename:="C:\path\to.txt", Origin _
        :=-535, StartRow:=16, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1 _
        ), Array(14, 1), Array(58, 1), Array(68, 1)), TrailingMinusNumbers:=True
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:39:16+00:00Added an answer on June 8, 2026 at 11:39 pm

    I just solved the problem on a different way. I don’t use the OpenText method anymore. I used following code to insert from clipboard into my worksheet:

    Range("A1").Select
    ActiveSheet.Paste
    

    This isn’t the answer of my question, but looks much easier to me as the answer before. It also worked, but i had to import library manually and write a lot more code.
    The way i have to access the code is now another. I jump from line to line, get save the line in a variable, delete the whitespace from the string

    stringLine = Replace(Range("A" & row).Value, " ", "")
    

    and create an array with the several values by using

    anArray = Split(stringLine, "|")
    

    Anyway, thank you for help 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am try to create an uploader in excel using vb (macro) to store
I try to create a new file inside a JSP and try to save
At the moment I have this: try{ // Create file FileWriter fstream = new
I have an excel template that uses a macro to save the file, so
I try to create a simple heroku app which clones a git repository, invokes
I try to create cross toolchian for arm but have this error: In file
I want to create a Clojure macro that can read a file, when the
I am writing a Macro in excel VBA that creates a data validation list
I'm trying to create a php file which I can edit straight away without
I have an Excel workbook that has a macro (the only macro in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.