Read Specific Words in Notepad Using VBA

D159M

New Member
Joined
Apr 24, 2020
Messages
1
Office Version
  1. 2007
Platform
  1. Windows
Hi,
I want to do following when I Open Excel File using VBA Code :
1. Notepad is created in "C:\Users\HOME\Desktop\Testing\notepad.txt" and in notepad I have type "123ABC123"
2. Now when I open the Excel file; it should read the notepad from above path and then check whether notepad has "123ABC123". and if condition is correct then the excel will open. If wrong then error message will show.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi D159M.
welcome to the forum. To start: this forum is not a free coding service, people here are volunteers that can help you, but you'll have to show some effort yourself. What you describe is very well possible: with VBA you can open a text file before opening the Excel file itself. You'd build some code in Workbook_Open , see e.g. this tutorial: The VBA Guide To Interacting With Text (.Txt) Files — The Spreadsheet Guru
Cheers,
Koen
 
Upvote 0

Forum statistics

Threads
1,215,721
Messages
6,126,461
Members
449,315
Latest member
misterzim

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