Exporting excel to text file

E

Exceluser

Hi,
Thanks so much for your help. I am just learning VSB. I guess that's
why I am so "slow". What is "filenumber"? It's not a built in, so what
do I change it to? The error it's giving is "Runtime error "1004"
Application defined or objective-defined error"

I am using Microsoft Excel 2003, with Visual basic 6.3
Email: [email protected]

thanks
 
A

A C

Hi,
Thanks so much for your help. I am just learning VSB. I guess that's
why I am so "slow". What is "filenumber"? It's not a built in, so what
do I change it to? The error it's giving is "Runtime error "1004"
Application defined or objective-defined error"

I am using Microsoft Excel 2003, with Visual basic 6.3
Email: [email protected]

thanks

filenumber is just a new local variable which is going to hold the system
fiile number than FreeFile returns. You could just as legitimately named it
myFilenumber, or even myWheelbarrow if you felt so inclined.

One of the things you should check is your references. Open visual basic
for your workbook, then click Tools-->References.
You should have something like the following ticked (ticked references will
be at the top of the list), although the numbers may be slightly different:
-Visual Basic For Applications
-Microsoft Excel 10.0 object library (possibly a diff number)
-OLE Automation
-Microsoft Office 10.0 Object library ("" "")
If not, find them in the list and tick them and try and run it. Not all of
the above are actually required, but as you may well extend the
functionality of your program at a later date it's a good base set to start
with (ie you could get away with less but you dont want to be dealing with
not having the proper references if you extend your code at a later date so
the above is a good set to have).

I have sent you an email with my test book in it so you can see a version
which works. If it doesnt work then this may indicate an issue with your
system. I have made some slight tweaks to it so that it explicitly lists
the object/variable types. You will see what I mean when you compare the
new code to the original code posted.

Regards
A
 
Top