How to write a small file to the disk using VBA5?

  • Thread starter Thread starter Vik Rubenfeld
  • Start date Start date
V

Vik Rubenfeld

I have an Excel spreadsheet that I might be able to sell. I want to put
together a small add-in that would contain the required functions, and
that would run for a number of days, and then require the user to enter
a serial number.

I guess to get the serial number code to work, I would just have to
write out a small file to the standard preferences folder containing the
appropriate information. My visual basic reference book talks about
creating and saving spreadsheets. Is there a way to read and write a
file, invisibly to the user (which of course is how these things work)
from VBA5? Thanks in advance to all for any info.


-Vik
 
Vik Rubenfeld said:
I have an Excel spreadsheet that I might be able to sell. I want to put
together a small add-in that would contain the required functions, and
that would run for a number of days, and then require the user to enter
a serial number.

I guess to get the serial number code to work, I would just have to
write out a small file to the standard preferences folder containing the
appropriate information. My visual basic reference book talks about
creating and saving spreadsheets. Is there a way to read and write a
file, invisibly to the user (which of course is how these things work)
from VBA5? Thanks in advance to all for any info.

P.S. I should be more specific about what I mean by "read and write a
file, invisibly to the user." I mean that the user would not be asked
where the file would be stored on the disk -- the file would just be put
there. The user would see no sign that any file was being created or
written to/read from the disk.
 
Not very secure, the user might find the file and fix it. Add-ins are not
secure, even when password protected, so don't rely on that. Also, what
happens if you don't have permissions to write the file.

The only secure way IMO is to encapsulate your code in a DLL which is more
difficult, and maybe buy one of the products that age software.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
I agree, it's not very secure, but it may be secure enough for my
purposes. Is it possible to do it with VBA5?

-Vik
 
Vik,

If you find that level of security acceptable, may I suggest that you look
at SaveSetting and GetSetting methods. These write to a special area in the
registry, and again it can be done without the user knowing.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top