Completed

Create VBA Code to Open A File(repost)

Changed the scope

New Scope

Upgrade existing code to check and see if directory exist

If it does continue

If it does not pop up a message asking if user wants it created

if no end routine, if yes continue.

here is existing code

Sub Open_File()

Dim strFile As String

Dim strFilePath As String

Dim i As Integer

strFile = "MyFile Name"

strFilePath = "C:\Reports"

strFileName = Format(Now, "mm-dd-yyyy") & strFile

outputFile = FreeFile

Open strFilePath & "\" & strFileName & ".txt" For Output As outputFile

For i = 1 To 20

Write #outputFile, "test line"

Next

Close outputFile

Exit Sub

E_Handler:

MsgBox "Error " + CStr([url removed, login to view]) + "!: " + [url removed, login to view]

End Sub

Skills: Visual Basic for Apps

See more: code line, vba error, end vba, test applications, open file, code check, 504, file exist, string integer, code test, vba string, visual basic repost, error txt, create check file, check file format, routine visual basic, code vba, check file, create VBA, vba end

About the Employer:
( 171 reviews ) Lakewood, United States

Project ID: #2709434

Awarded to:

sudhas08

See private message.

$8 USD in 1 day
(1 Review)
0.0

22 freelancers are bidding on average $18 for this job

chriskerpini

See private message.

$25.5 USD in 1 day
(13 Reviews)
4.3
franSystems

See private message.

$10 USD in 1 day
(53 Reviews)
4.3
gribfritz

See private message.

$25.5 USD in 1 day
(25 Reviews)
4.2
bfpickford

See private message.

$20.4 USD in 1 day
(17 Reviews)
4.1
DenisSmolentsev

See private message.

$15 USD in 1 day
(23 Reviews)
3.8
torajiv

See private message.

$10 USD in 1 day
(14 Reviews)
3.7
customizedata

See private message.

$20.4 USD in 1 day
(7 Reviews)
3.5
ysrahmed

See private message.

$20 USD in 1 day
(5 Reviews)
2.8
waster

See private message.

$25.5 USD in 1 day
(6 Reviews)
2.5
northwolves

See private message.

$8 USD in 1 day
(2 Reviews)
2.2
ineedWorkJob

See private message.

$10 USD in 1 day
(3 Reviews)
1.9
soft1serve

See private message.

$20 USD in 1 day
(1 Review)
1.9
yubor

See private message.

$10 USD in 1 day
(2 Reviews)
1.5
prashant542

See private message.

$5 USD in 1 day
(7 Reviews)
1.4
nithyarajeshg

See private message.

$5 USD in 1 day
(6 Reviews)
1.2
egy1st

See private message.

$2 USD in 1 day
(0 Reviews)
0.0
richardjs

See private message.

$13 USD in 1 day
(0 Reviews)
0.0
jameswbrown

See private message.

$25.5 USD in 1 day
(0 Reviews)
0.0
jgsini

See private message.

$100.3 USD in 1 day
(0 Reviews)
0.0
vmedvedev

See private message.

$5 USD in 1 day
(0 Reviews)
0.0