VBA Excel Write integer to file

Joined
Aug 11, 2011
Messages
2
Reaction score
0
14 Hours Ago Hi,

i am wondering if anyone can help.

i am pulling me hair out trying to figure this out.

Basicially i have a macro that reads a line of text from a text file, for example "Davidmorrison=000001" and then splits this text by the equal symbol and creates an array.

Now what i need this to do is to take the array numbered 1 which is "000001" and add 1 digit so it will become "000002" and write this new number to the current line it split from.

But when it becomes 2 digits for example "000010" it loses one of the zeros.

Can anyone help ?


 
Joined
Sep 26, 2011
Messages
1
Reaction score
0
Hi...Please help me with below query.....

Below code is not working in windows 7, but it is working fine in win XP....


Code:

Dim Inet1 As Inet

Set Inet1 = New Inet

With Inet1
.URL = HostName
.UserName = UserName
.Password = Password
.Execute , "PUT " & LocalFileName & " " & RemoteFileName

Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
Set Inet1 = Nothing
 
Joined
Feb 21, 2018
Messages
216
Reaction score
86
14 Hours Ago Hi,

i am wondering if anyone can help.

i am pulling me hair out trying to figure this out.

Basicially i have a macro that reads a line of text from a text file, for example "Davidmorrison=000001" and then splits this text by the equal symbol and creates an array.

Now what i need this to do is to take the array numbered 1 which is "000001" and add 1 digit so it will become "000002" and write this new number to the current line it split from.

But when it becomes 2 digits for example "000010" it loses one of the zeros.

Can anyone help ?


Just saw your query....Should you still need the solution...please do let me know...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top