Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
xux xux is offline
external usenet poster
 
Posts: 1
Default What are hidden processes of SaveAs function

I wrote a program in VB.Net (doesn't matter). The program will save a
modified excel book to a new filename. The window login user shall not have
permission to write files to the destination folder. The program uses
Impersonation of another user (have permission to write to the folder). Here
is the simple logic:
Impersonate()
MyBook.SaveAs (theTagartFile)
UnImpersonate()
However, I have problem with this. It seems when using SaveAs or Save, it
switches to window user instead of using the impersonated user. I have used
Implersonate functions in many places in the application without any problem.
But with this excel save or SaveAs, it gets a permission error. Luckly I had
anthoer program that finds out the SaveAs involves many intermediate steps
(processes) such as creating, modifying, and deleting temporary files. But I
can not see if any temp files created in other folders. Anyone knows the
detail process of SaveAs function?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default What are hidden processes of SaveAs function

I suppose you have tried just recording a macro?

ChDir "D:\documents and settings\blab\Desktop\workbook.xls"
ActiveWorkbook.SaveAs Filename:= _
"D:\documents and settings\blab\Desktop\filename\workbook.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

The password stuff may get you hung up, but that is about all i can see.

"xux" wrote:

I wrote a program in VB.Net (doesn't matter). The program will save a
modified excel book to a new filename. The window login user shall not have
permission to write files to the destination folder. The program uses
Impersonation of another user (have permission to write to the folder). Here
is the simple logic:
Impersonate()
MyBook.SaveAs (theTagartFile)
UnImpersonate()
However, I have problem with this. It seems when using SaveAs or Save, it
switches to window user instead of using the impersonated user. I have used
Implersonate functions in many places in the application without any problem.
But with this excel save or SaveAs, it gets a permission error. Luckly I had
anthoer program that finds out the SaveAs involves many intermediate steps
(processes) such as creating, modifying, and deleting temporary files. But I
can not see if any temp files created in other folders. Anyone knows the
detail process of SaveAs function?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default What are hidden processes of SaveAs function

Hi xux,

xux wrote:
I wrote a program in VB.Net (doesn't matter). The program will save a
modified excel book to a new filename. The window login user shall
not have permission to write files to the destination folder. The
program uses Impersonation of another user (have permission to write
to the folder). Here is the simple logic:
Impersonate()
MyBook.SaveAs (theTagartFile)
UnImpersonate()
However, I have problem with this. It seems when using SaveAs or
Save, it switches to window user instead of using the impersonated
user. I have used Implersonate functions in many places in the
application without any problem. But with this excel save or SaveAs,
it gets a permission error. Luckly I had anthoer program that finds
out the SaveAs involves many intermediate steps (processes) such as
creating, modifying, and deleting temporary files. But I can not see
if any temp files created in other folders. Anyone knows the detail
process of SaveAs function?


I don't really know the internals of the SaveAs method, but have you tried
using filemon from sysinternals? You should be able to see exactly where
the access denied error is cropping up with that tool. Maybe it's the one
you referred to.

--
Regards,

Jake Marx
www.longhead.com


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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Processes in one cell jai Excel Discussion (Misc queries) 2 January 25th 08 05:06 PM
Display System Processes Ashley Excel Programming 1 December 22nd 05 03:27 AM
SaveAs and Hidden Workbooks wtpcomplab Excel Programming 1 December 11th 04 01:27 AM
Multiple Excel Processes MDW Excel Programming 2 September 7th 04 05:53 PM
hiding processes marta Excel Programming 2 July 23rd 04 05:35 PM


All times are GMT +1. The time now is 04:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"