Solved

Excel 2007 VBA Save As .. File Format

Posted on 2012-03-20
3
416 Views
Last Modified: 2012-06-21
Hi

I hope you can help me with this.

I have various bits of VBA that manipulate data from different sources ready for upload into Access.  The user needs to be able to pick up the upload file, but whatever format I save it as, Excel won't recognise it to reopen it.  I've dredged the web and have tried more versions of "FileFormat:=" than you can imagine!

The code button above won't don't anything, so here's the relevant bit of code:

    uploadName = Application.GetSaveAsFilename
   
    ActiveWorkbook.SaveAs Filename:= _
        uploadName, FileFormat:=56, Password:="", WriteResPassword:="", _
        ReadOnlyRecommended:=False, CreateBackup:=False

I'm awarding 500 points for a quick answer that works.

Thanks
Sarah
0
Comment
Question by:ScuzzyJo
  • 2
3 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 37741646
Is there an extension on the end of uploadName? If so, what is it?
0
 

Author Comment

by:ScuzzyJo
ID: 37741727
Hi Rory

I hadn't put a file extension on, so I tried that and it worked fine.

Thanks...:-)

I'll close the question and award the points, but I'll have to do it via my phone as we're only allowed IE6 here and I can't see the close button on the page, so please bear with me.

I have another question too, so I'll post that in a minute.

Thanks
Sarah
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37741745
No rush. :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now