So like the headline says: Why is Excel VBA executing a command correctly if I run it in debug modus, but in "normal" modus it does nothing?
It is about the command:
![]()
Please Login or Register to view this content.
So like the headline says: Why is Excel VBA executing a command correctly if I run it in debug modus, but in "normal" modus it does nothing?
It is about the command:
![]()
Please Login or Register to view this content.
Last edited by zbor; 04-02-2015 at 05:52 AM. Reason: Code tags
Try to wait some time so it can execute properly.
This will wait 2 seconds but try few time and adjust for yourself:
Also, please use code tags around your code as per forum rules. I've edit now for you.![]()
Please Login or Register to view this content.
Never use Merged Cells in Excel
Thanks for editing and answering. That was the solution. But even then there is a problem. I want to execute this command to upload my excel workbook to a ftp and the time the shell needs depends highly on the file I'm uploading. It can between 0,7mb and 200mb. The time is of course very different then. Is it possible to set the timeout according to it?
You can try with FileLen function:
test size before executing Shell.![]()
Please Login or Register to view this content.
Then try for some different lenght how many time each file size need to upload.
If you can determine needed time comparing to file size you can adjust Wait function.
Add few seconds just in case but even that won't guarantee that it will work each time because your speed can vary.
The problem is that the filesize is not linear proportional to the upload time. E.g. If the i-net connection is slow it takes much longer to upload. Is there another way to let excel vba execute the command properly no matter how long the upload takes?
Last edited by flextexmex; 04-02-2015 at 06:16 AM.
Yes, I know.
Are you uploading lot of files one after other or just few?
Just one file 2 times with a size of maximum 200mb. But the upload time can vary very much... it can take up to 30 minutes...
Last edited by flextexmex; 04-02-2015 at 06:24 AM.
I would still make this corelation and then you can have one dummy file (let say 2MB) that will be uploaded first and then aproximate for those largest files.
Or just put 1 hour and let it over night to upload![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks