Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-19-2014, 08:57 AM
BobBridges's Avatar
BobBridges BobBridges is offline Choose file name Save As macro Windows 7 64bit Choose file name Save As macro Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

I have occasionally deleted files, renamed them, or created folders while in an Excel file dialog. But I hardly ever plan that ahead of time; it's more of an oh-while-I'm-there sort of thing.



But as for opening a non-Excel file: If I open (say) a text file from within Excel, it just tried to import it into Excel, no?
Reply With Quote
  #2  
Old 07-22-2014, 08:52 AM
gbaker gbaker is offline Choose file name Save As macro Windows 7 32bit Choose file name Save As macro Office 2010 32bit
Competent Performer
Choose file name Save As macro
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Save As Not Working

Hi Ribbons,
I thought the code below would work. It does to a point. It gets me to the folder on the network and also allows me to change the name for the file but when I click save it doesn't actually save the file. Any Idea's, I really need to get this to work:

Code:
Dim varResult As Variant
'displays the save file dialog
varResult = Application.GetSaveAsFilename(fileFilter:= _
    "Excel Files (*.xlsx), *.xlsx, Macro Enabled Workbook" & _
    "(*.xlsm), *xlsm", Title:="Some Random Title", _
    InitialFileName:="\\fngn.com\us\Projects\ProgramOps\Exceptions Masters & Data\Aon Hewitt")
'checks to make sure the user hasn't canceled the dialog
If varResult <> False Then
    Cells(2, 1) = varResult
   
End If
I think I am missing something.
Thanks in advance
gbaker
Reply With Quote
  #3  
Old 07-21-2014, 08:46 AM
WeDonNeedNoSteenkgRibbons's Avatar
WeDonNeedNoSteenkgRibbons WeDonNeedNoSteenkgRibbons is offline Choose file name Save As macro Windows XP Choose file name Save As macro Office 2003
Novice
 
Join Date: Jul 2014
Posts: 23
WeDonNeedNoSteenkgRibbons is on a distinguished road
Default

Thank you for following through. You're right, I overspoke. Opening is interpreted as "open in Excel" even for, say, a PDF, in Excel. Oops - I've only actually deleted files that way, FROM EXCEL. Interestingly, Save As in some other Office products doesn't try to open something in that product. E.g. in Notepad if you go Save As, you can right click and open Excel files. I've actually done that, but I erred in generalizing that behavior to Excel. Either it's a different Save As dialog, or is interpreted differently by Excel.

"oh-while-I'm-there sort of thing" is a perfect description of what it achieves for me as well. It's not a "normal" way to do Explorer operations, but if it works, and you're sitting in a folder of interest, what the heck.
Reply With Quote
  #4  
Old 07-22-2014, 12:30 PM
WeDonNeedNoSteenkgRibbons's Avatar
WeDonNeedNoSteenkgRibbons WeDonNeedNoSteenkgRibbons is offline Choose file name Save As macro Windows XP Choose file name Save As macro Office 2003
Novice
 
Join Date: Jul 2014
Posts: 23
WeDonNeedNoSteenkgRibbons is on a distinguished road
Default

As to learning VBA: sorry for my limited input as I only have occasional small chunks of time nowabouts. You know, the way I originally learned everything about computers was with a guru at my side - a coworker, professor, fellow student, neighbor, member of a user group. Ultimately my competency was sufficient that I could do basically what I wanted, and could *then* be able to live with getting small chunks of info from the googling or forums - e.g. fixing a single line of code. But I have to confess, I HAD to have an expert in order to get cranking on areas I didn't know, whether that was Assembler language, VBA, spreadsheets or databases.

The alternative to that is "Teach Yourself" books. The "in 14 days" or "in 30 days" ones work extremely well for some. That's how I learned Access. OTOH for Foxpro I had a guy that I asked 120 questions per day.

My stance is to invest the time in order to get an excellent result, though I know the world is not always accommodating in that regard.

Here's something else I have been required to do to use code effectively: step through the code with F8 and shift-F8. Watch what happens on each and every executed line. Use the debug window to confirm assignments. I can't give you a full tutorial on this process but urge you to consider books, or better yet, gurus in the room or on the phone, that can develop this skill. That will, I believe, achieve 98% of what you ever want to do in programming.

You can get there in a month of "teach yourself" work, most likely. Or in a day if you have full time real-time access to a guru. Or take a course. That's my best advice.
Reply With Quote
  #5  
Old 07-22-2014, 12:48 PM
gbaker gbaker is offline Choose file name Save As macro Windows 7 32bit Choose file name Save As macro Office 2010 32bit
Competent Performer
Choose file name Save As macro
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Save As Not Working

Hi Ribbons,
I did take your suggestion and am using the step through approach, Thanks

I've been working in excel for many many years, mostly with formula's, drop downs, VLookup and other functions in excel. For the past 3-4 years I've been recording macro's to make things work the way I want. I usually go to the forum when I get stuck and usually can get enough help to get the job done. Your right in a perfect world their would be more time to learn. I don't have a Guru to help and never did. I had to learn on my own spending countless hours over the years to become somewhat knowledgeable. Still have a lot to learn. I also did some Foxpro years ago and that helped some.

I will take Bob's advise and try to spend some time with the VBA documentation.

I appreciate all of your assistance in this project and I'm sure I will have other questions. I have 2 workbooks done and still have to design 3 more. Each one has different criteria. All need to be saved using a macro so the user won't break the original and doesn't have to think too much, I'm sure you know what I mean.

Thanks Again. gbaker
Reply With Quote
  #6  
Old 07-22-2014, 03:54 PM
BobBridges's Avatar
BobBridges BobBridges is offline Choose file name Save As macro Windows 7 64bit Choose file name Save As macro Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

I agree with most of Ribbons' advice, gbaker. My own approach, throughout my life, when I haven't been able to get my employers to pay for a class (and how often does that happen? Good training is expensive, after all), has been to steal slices of time here and there, teaching myself incrementally. So this week I have a new task to perform, and my boss says "now, Bob, I know you like to automate things, but this time we haven't got time for you to write a program; just do it". ("Tom", I complained more than once, "you like me to know all this stuff but you never want me to learn it." He laughed and acknowledged the justice of my accusation—but nevertheless, this time I should just do it.) So increasingly I ignored that directive and spent some time learning something new anyway. If I thought I'd need a day to do something the hard way, but I suspected I could do it quicker if I learned a new tool, then I took an hour or two to get started on that tool. Then, if necessary, I went back to the hard way; but by then I had an hour or two's worth of new information that would make the task go that much faster the next time.

The result now is that I can do things faster and more reliably in several languages and platforms, making me much more valuable to the boss who didn't want to spare the time. So will you, if you keep at it.

I agree with Ribbons; you'll spend all your life learning more (if you don't balk at it), but a month of this sort of self-training will give you a tremendous improvement in your abilities. I don't think a day with a guru will equal it; a guru is nice to have on call, but in my experience he can only give you those critical hints now and then, while the real learning happens while you're struggling and sweating over a difficult problem.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Choose file name Save As macro Macro to save as pdf with ability to choose save as folder rvessio Word VBA 4 07-25-2016 12:37 PM
Choose file name Save As macro Outlook 2010 Macro Save as MSG, Choose Destination, set default filename rslck Outlook 1 06-19-2014 10:16 AM
Choose file name Save As macro Save As Macro that changes the file name also rosscortb Word VBA 5 05-19-2014 08:40 AM
How do I save a Word file with a macro for distribution? leemoreau Word VBA 3 10-04-2013 08:06 AM
Choose file name Save As macro Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft