469,273 Members | 1,786 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,273 developers. It's quick & easy.

Upload Excel with Macros using HTML File Upload

Hi,

We face problems uploading excel (with macros) documents using HTML
File Upload.
The file contents are corrupted while viewing the same. However, we
are able to upload excel (w/o. macros) documents successfully. Is
there anything we have to take care of, while handling uploads of
excel documents with macros?

Thanks in advance,
Prakash.
Jul 19 '05 #1
3 5556
What is it that tells you that the files are corrupted? Whether or not the
workbook has macros should have no effect on the upload. It's just a file
like anything else.

Ray at work

"Prakash" <pr********@rediffmail.com> wrote in message
news:39**************************@posting.google.c om...
Hi,

We face problems uploading excel (with macros) documents using HTML
File Upload.
The file contents are corrupted while viewing the same. However, we
are able to upload excel (w/o. macros) documents successfully. Is
there anything we have to take care of, while handling uploads of
excel documents with macros?

Thanks in advance,
Prakash.

Jul 19 '05 #2
Hi,

Thanks for ur reply. We came to know that the file is corrupted on
viewing the same. The contents were completely destroyed and it was
like this:

These are the steps followed by us:
We retrieve the file contents from the html file upload control like
this:
Form("filFile")("Value")
where filFile is the name of the file control. Then we pass this to
the method of a COM component where it is saved using Binary access.

Open strFileName For Output As lngFileNumber
Print #lngFileNumber, strFileContents;
Close #lngFileNumber

where strFileContents contains the File contents retrieved from HTML
file control. Are we missing anything in this? However, we were able
to upload and view other excel documents successfully.

Another query is:
Is there any security setting in IE which prevents macros files to
change like these while uploading. If so, how to tackle this?
Thanks.
Prakash.

THIS WAS THE PART OF CONTENT WE FOUND ON OPENING THE EXCEL FILE:
================================================== =============
COURTESY RESPONSE #0application/vnd.ms-excelл¤ЯА▒р>■  >■                                                                                                                                                                                                                                                                                                                                                      
                                                                                                   §    =

 !"#$%&'()*+,-./0123456789:;<■   GQ@ABCDEFHPIJKLMNOR■   ■   S■                                                                                                                                                                                       Root
Entry         └FЯaХ4Ц├?г
"Workbook        Лu_VBA_PROJECT_CUR" ░Бsxжб├
▄гxжб├VBA        ░vxжб├P:Sxжб├ F═╔г р░┴Р\pPrakash
B░a└=М║ ThisWorkbookS»╝=x<L;Ђ$8X@Ї"и ┌1╚ љArial1╚ љArial1╚ љArial1╚  љArial1╚ ╝Arial1
QљTahoma1 Q╝Tahoma1  љTahoma1  ╝Arial1
QљTahoma1  љArial1╚ љArial1╚$љArial"$"#,##0_);\("$"#,## 0\)!"$"#,##0_);[Red]\("$"#,##0\)""$"#,##0.00_);\("$"#,##0.00\)' ""$"#,##0.00_);[Red]\("$"#,##0.00\)7*2_("$"*
#,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_).))_(* #,##0_);_(*
\(#,##0\);_(* "-"_);_(@_)?,:_("$"* #,##0.00_);_("$"*
\(#,##0.00\);_("$"* "-"??_);_(@_)6+1_(* #,##0.00_);_(*
\(#,##0.00\);_(* "-"??_);_(@_)ц"Yes";"Yes";"No"Ц"True";"True" ;"False"д"On";"On";"Off"
Д00000Яш  └ Яш  З└ Яш  З└ Яш  З└ Яш  З└ Яш  З└ Яш  З└ Яш 
З└ Яш  З└ Яш  З└ Яш  З└ Яш  З└ Яш  З└ Яш  З└ Яш  З└ Я └
Я+ш  Э└ Я)ш  Э└ Я,ш  Э└ Я*ш  Э└ Я
З З└ Я З З└ Я ш  Э└ Я └ Я └ Я"└ Я  @└ Я @└ Я
└ Я  @ └ Я └ Я └ Я @└ Я!└ Я (@@└ Я"░@└
Я"░└ Я"љ└ Я г └ Я  (@└ Я"0@└ Я"0└ Я  (@└ Я (└ └ Я
└ └ Я"└ Я"8@└ Я *└ Я *8└ Я 8@@└ Я(└ Я!8@@└
Я @
Я @
Я H
 эЧЬE&Vendor / Work Center(Lot Date / Revision Level / Order
numberSuspected defectScrapReworkSortQA Hold
Requested by:Part Number(s)Date:WIP DispositionRework
Information:WC to Rework / SortWork Center ResponsibilityShop Order
Number Comments:Special Inspection/Actions:QAID #!Other pages
attached as required.Actions for Inventory(requires
explanation)Vendor
Volume sorted
Volume PassedVolume Scrapped!Description & Picture (if needed)GTest /
Measurement Method &/or Description (if additional space
needed)Result:OriginOtherInventory Comments Use as is
Contain at WCStop ProductionStop cust. Shipments
Contact Cust.Vendor Comment FieldRouting *ж p 'Е╠eк
F═╔г   h <Ж!r(J*
 dЧЕымMbP?_*+ г % Ђ┴96&L&"Arial,Bold"&14RMQD
Sheet&C&"Arial,Bold"&12QAP-1017&R&"Arial,Bold"&11 11/27/02'
&& вQИН?'«Gрz«О?(Я?)л?MHP LaserJet 5Pн@gШЩ
,,@MSUDHP LaserJet 5PС<d
А"d,,л?л?Пc╠U} I} I} 


"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:<u0**************@TK2MSFTNGP10.phx.gbl>...
What is it that tells you that the files are corrupted? Whether or not the
workbook has macros should have no effect on the upload. It's just a file
like anything else.

Ray at work

"Prakash" <pr********@rediffmail.com> wrote in message
news:39**************************@posting.google.c om...
Hi,

We face problems uploading excel (with macros) documents using HTML
File Upload.
The file contents are corrupted while viewing the same. However, we
are able to upload excel (w/o. macros) documents successfully. Is
there anything we have to take care of, while handling uploads of
excel documents with macros?

Thanks in advance,
Prakash.

Jul 19 '05 #3
I'm not vb expert, so you may want to post to a VB group, but if you're
writing a binary file, shouldn't you do:

open strFilename for BINARY as #1
put #1, strFilecontents
Close #1

Ray at home

"Prakash" <pr********@rediffmail.com> wrote in message
news:39**************************@posting.google.c om...
Hi,

Thanks for ur reply. We came to know that the file is corrupted on
viewing the same. The contents were completely destroyed and it was
like this:

These are the steps followed by us:
We retrieve the file contents from the html file upload control like
this:
Form("filFile")("Value")
where filFile is the name of the file control. Then we pass this to
the method of a COM component where it is saved using Binary access.

Open strFileName For Output As lngFileNumber
Print #lngFileNumber, strFileContents;
Close #lngFileNumber

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Seok Bee | last post: by
1 post views Thread by =?Utf-8?B?TGFtaXM=?= | last post: by
8 posts views Thread by =?Utf-8?B?SmVycnkgQw==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.