View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default well..

Hmm...I don't see anything there that would cause a shortcut to be created.
Where exactly is the shortcut to the XL file being created? In the root of
C:? And it's a true shortcut, not a copy of the new XL file?

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


nitm wrote:
here are parts of the code that i think that have something to do
with the problem (you don't want to see the whole code):

tmpfilename = "tmp_" & Int((99 - 10 + 1) * Rnd + 10) &"_" & Int((999
- 100 + 1) * Rnd + 100) & ".xls"
objfso.CopyFile Server.MapPath("emplate.xls"),
Server.MapPath(tmpfilename), true

Dim objExcel, objWorkBook, objSheet
Set objExcel = Server.CreateObject("Excel.Application")
objExcel.Visible = False
objExcel.DisplayAlerts = False

Set objWorkBook = objExcel.Workbooks.Open(Server.MapPath(mpfilename) )
for each objSheet in objWorkBook.Sheets
if InStr(1,tbls,"," & getTblNum(objSheet.Name) & ",") = 0 then
objSheet.Delete
end if
next

objWorkBook.Close True
Set objWorkBook = Nothing
objExcel.Quit
Set objExcel = Nothing

here's what i'm doing:
there's a template file on da server (xls file) with some sheets in
it.
i copy this file and i'm giving it a random name so that if more than
one user attempts this it won't crush.

after that i iterate thru all of the sheets in the temp file and
check if the user asked for the sheet, if not i delete the sheet from
the temp file.

that's the code that i just gave you, after that i send the temp file
to the user and at the end i delete the file with the file system
object (asp).

hope this explains it all.
thanks a lot.

"Jake Marx" wrote:

Hi nitm,

How are you creating the Excel workbooks on the server? Using
Server.CreateObject, using an HTML file upload, or some other way?
How are you saving the file? If you can provide more detail
(including relevant lines of code), that would make it much easier
to diagnose.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


nitm wrote:
hi all.
i'm creating a system that works on the net.
i'm writing it with asp and one of the functions of the system is to
import data from excel files into the system (access db).
everything is going swell, except one thing.
whenever the system creates a new excel workbook and saves it as xls
file something (i don't know what) is creating a shortcut to that
file and places it in the system drive (c:\).
the xls files that the system creates are only temp files and they
are deleted after being used. the shortcuts remain.

i can't figure out why this is happenning and i really want it to
stop!
i can't delete the shortcuts with asp because the system will be
hosted on a server that has nothing to do with me and i have no idea
if i'll have access to the system drive (probably not).
i'm kind of stuck here.

i would love to get any ideas of why this is happenning and how can
i avoid it.
thanks a lot!
nitm;