Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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; |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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; |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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; |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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; |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i don't see that either.
yes, the shortctus are being created in the root of the system drive (it's d: in my machine but c: in the server which i tested it on). and yes, it's a true shortcut, not a copy of the xls file. i see only two options for which lines are the ones that causing it: (1) Set objWorkBook = objExcel.Workbooks.Open(Server.MapPath(mpfilename) ) (2) objWorkBook.Close True these are the only ones that looks like they might do something stupid enough... thanks. "Jake Marx" wrote: 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; |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
nitm wrote:
i don't see that either. yes, the shortctus are being created in the root of the system drive (it's d: in my machine but c: in the server which i tested it on). and yes, it's a true shortcut, not a copy of the xls file. So this happens on your development machine as well? i see only two options for which lines are the ones that causing it: (1) Set objWorkBook = objExcel.Workbooks.Open(Server.MapPath(mpfilename) ) (2) objWorkBook.Close True Errors in Automating Excel can definitely cause problems, but mostly with Excel processes hanging around after you meant to close them. I've never seen shortcuts created willy-nilly like this. Have you determined at what point in the process the shortcut actually shows up in the C:\ folder? -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel files on USB -- taskbar shortcuts don't work | Excel Discussion (Misc queries) | |||
How to remove listed shortcuts for deleted Excel files? | Excel Discussion (Misc queries) | |||
all my shortcuts to excel files open up as a picture | Excel Discussion (Misc queries) | |||
shortcuts in Excel | Excel Worksheet Functions | |||
How to disable the shortcuts of excel files created by MSExcel 20. | Excel Discussion (Misc queries) |