ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Question for Dave Peterson (https://www.excelbanter.com/excel-discussion-misc-queries/181798-question-dave-peterson.html)

Jenny B.

Question for Dave Peterson
 
Hi Dave,

Earlier this week, you responded to a question I had and Im wondering if
you can help me once again.

Since I havent picked up on this project again until now, I didnt realize
I made a mistake and the solution you provided me with didnt quite work like
I thought. I had requested a way to automatically save a copy of the current
users workbook page to the desktop without the code being specific (this
will be accessed by multiple users). When I replace SpecialFolders (10) with
SpecialFolders (€śDesktop€ť), the file still saves in the same place €“
C:\Documents and Settings\Jenny and its title is now Desktop and the range
value (not quite correct).

I know Im just missing just one step to have it placed directly in the
Desktop Folder (so it will appear on my desktop), but Im not sure how to
accomplish it.

Thank you for your thoughts in advance €“ Jenny B.


Dave Peterson

Question for Dave Peterson
 
Just a guess.

I'm betting that you're missing a backslash in your code.

Option Explicit
Sub DesktopSave()

Dim myPath As String
Dim nRng As Range
Dim fName As String

Set nRng = ActiveSheet.Range("H5")

ActiveSheet.Copy

myPath = CreateObject("WScript.Shell").SpecialFolders(10)

fName = nRng.Value & ".xls"

ActiveWorkbook.SaveAs Filename:=myPath & "\" & fName, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

ActiveWorkbook.Close

Call TransfertoLog

Call Clear

End Sub




Jenny B. wrote:

Hi Dave,

Earlier this week, you responded to a question I had and Im wondering if
you can help me once again.

Since I havent picked up on this project again until now, I didnt realize
I made a mistake and the solution you provided me with didnt quite work like
I thought. I had requested a way to automatically save a copy of the current
users workbook page to the desktop without the code being specific (this
will be accessed by multiple users). When I replace SpecialFolders (10) with
SpecialFolders (€śDesktop€ť), the file still saves in the same place €“
C:\Documents and Settings\Jenny and its title is now Desktop and the range
value (not quite correct).

I know Im just missing just one step to have it placed directly in the
Desktop Folder (so it will appear on my desktop), but Im not sure how to
accomplish it.

Thank you for your thoughts in advance €“ Jenny B.


--

Dave Peterson

Dave Peterson

Question for Dave Peterson
 
Ps. it's usually a good idea to post the code (or snippet of code) that's
causing the trouble. That way, potential responders don't have to spend too
much time looking for your old posts.



Jenny B. wrote:

Hi Dave,

Earlier this week, you responded to a question I had and Im wondering if
you can help me once again.

Since I havent picked up on this project again until now, I didnt realize
I made a mistake and the solution you provided me with didnt quite work like
I thought. I had requested a way to automatically save a copy of the current
users workbook page to the desktop without the code being specific (this
will be accessed by multiple users). When I replace SpecialFolders (10) with
SpecialFolders (€śDesktop€ť), the file still saves in the same place €“
C:\Documents and Settings\Jenny and its title is now Desktop and the range
value (not quite correct).

I know Im just missing just one step to have it placed directly in the
Desktop Folder (so it will appear on my desktop), but Im not sure how to
accomplish it.

Thank you for your thoughts in advance €“ Jenny B.


--

Dave Peterson

Jenny B.

Question for Dave Peterson
 
Hi Dave,

Thank you so much. You were exactly right that I was missing a dash and now
it works fine.

Sorry for not providing the original code along with my question. I'm
usually a bit more on the ball, but I forgot and didn't attach it for that
particular post - my apologies

Thanks again and appreciate you taking the time to respond - Jenny B.


"Dave Peterson" wrote:

Ps. it's usually a good idea to post the code (or snippet of code) that's
causing the trouble. That way, potential responders don't have to spend too
much time looking for your old posts.



Jenny B. wrote:

Hi Dave,

Earlier this week, you responded to a question I had and I€„˘m wondering if
you can help me once again.

Since I haven€„˘t picked up on this project again until now, I didn€„˘t realize
I made a mistake and the solution you provided me with didn€„˘t quite work like
I thought. I had requested a way to automatically save a copy of the current
user€„˘s workbook page to the desktop without the code being specific (this
will be accessed by multiple users). When I replace SpecialFolders (10) with
SpecialFolders (€œDesktop€), the file still saves in the same place €€ś
C:\Documents and Settings\Jenny and it€„˘s title is now Desktop and the range
value (not quite correct).

I know I€„˘m just missing just one step to have it placed directly in the
Desktop Folder (so it will appear on my desktop), but I€„˘m not sure how to
accomplish it.

Thank you for your thoughts in advance €€ś Jenny B.


--

Dave Peterson


Dave Peterson

Question for Dave Peterson
 
Glad you got it working!

Jenny B. wrote:

Hi Dave,

Thank you so much. You were exactly right that I was missing a dash and now
it works fine.

Sorry for not providing the original code along with my question. I'm
usually a bit more on the ball, but I forgot and didn't attach it for that
particular post - my apologies

Thanks again and appreciate you taking the time to respond - Jenny B.

"Dave Peterson" wrote:

Ps. it's usually a good idea to post the code (or snippet of code) that's
causing the trouble. That way, potential responders don't have to spend too
much time looking for your old posts.



Jenny B. wrote:

Hi Dave,

Earlier this week, you responded to a question I had and I€„˘m wondering if
you can help me once again.

Since I haven€„˘t picked up on this project again until now, I didn€„˘t realize
I made a mistake and the solution you provided me with didn€„˘t quite work like
I thought. I had requested a way to automatically save a copy of the current
user€„˘s workbook page to the desktop without the code being specific (this
will be accessed by multiple users). When I replace SpecialFolders (10) with
SpecialFolders (€œDesktop€), the file still saves in the same place €€ś
C:\Documents and Settings\Jenny and it€„˘s title is now Desktop and the range
value (not quite correct).

I know I€„˘m just missing just one step to have it placed directly in the
Desktop Folder (so it will appear on my desktop), but I€„˘m not sure how to
accomplish it.

Thank you for your thoughts in advance €€ś Jenny B.


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 10:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com