Tuesday, November 16, 2010

Your assistance please?

In detail...

I have one batch file. This batch file is designed to print the file name in a folder. The command I have used is dir d:\FolderNameWhereFilesAreLocatedToPrint %26gt; d:\foldernameWhretheTxtFileBeCreated\txt鈥?/b . And then I import these data into an excel file and I saved this file on my computer, and it was working well. But when I try to open this excel file from other computer on the same network I was able to open the file but the data can't be refreshed. Whenever I open the file a dialog box is opened saying that 鈥淓xcel can't find the text file to refresh this external data range. Then I try to change the command in batchfile in to \\mycomputername\d:\FolderNameWhereFiles鈥?%26gt; d:\foldernameWhretheTxtFileBeCreated\txt鈥?/b. but it is not worked out. Can anybody help me out in this issue. I hope you all understand my problem. This excel file is to be shared to all on my network as all have to check the file.

in this excel file i have created one macro to run the batch file. This also working in my system

While when i try to open it from other computer it is showing a dialog box Error 5. What is it and how can i solve this issue.

Macro command is

Sub vchr_gvn()

'

' vchr_gvn Macro

' To run VchrGvn Batch file

'

' Keyboard Shortcut: Ctrl+r

'

Call Shell(';\\sa\batchfiles\shtg givn.bat';, vbNormalFocus)

End Sub

FYI.

I have shared this file, shared the folder and given permission.

Otherwise can you tell me other alternative to do all this things?

What I need is, I want to know the file names which contain in a folder and I want this names in a excel file and when I click on this file name in excel I need this file be opened. by using macro or any way. Remember I want to share this file with others on the same network.Your assistance please?
A few things to check

1. the path you provide is incorrect from network pov, it shouldn't has the d:\ in the middle, cause if that drive is shared, it should become something like a folder, may be is just ';d';

2. this line

Call Shell(';\\sa\batchfiles\shtg givn.bat';, vbNormalFocus)

may be needed to change to

Call Shell(';\\sa\batchfiles\shtg\ givn.bat';, vbNormalFocus) (note:added 1 space)

3. may be use excel to call the text file instead of using bat, Dos also has problem in networking especially with xp

Hope this helps.

No comments:

Post a Comment