How can I use VBA to convert SharePoint workbooks from 97-2003 format to 2007+ format?

I want to convert a workbook that lives on SharePoint from the old 97-2003 file format to the newer one.
The two CheckIn lines fail with "Subscript out of range". The workbook gets checked out, and the SaveAs works. But, once the workbook is saved as another name, I can't check in either workbook using VBA. If I close out of the new file name, it
asks if I want to check it in, and works if I say yes. But, VBA won't do it.
The old workbook seems to be no longer known by Excel once the SaveAs occurs, so I have to go to the SharePoint server and manually discard the checkout.
Sub Convert2003FileTo2007(DirectoryPath As String, FileName As String)
' Directory Path = \\servername
  ' FileName = xyz.xls, with no "x" at the end. Workbooks.CheckOut FileName:=DirectoryPath & "\" & FileName
Workbooks.Open FileName:=DirectoryPath & "\" & FileName
ActiveWorkbook.SaveAs _
FileName:=DirectoryPath & "\" & FileName & "x", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
' Each of these commands fail
Workbooks(DirectoryPath & "\" & FileName).CheckIn SaveChanges:=False
Workbooks(DirectoryPath & "\" & FileName & "x").CheckIn
End Sub ' Convert2003FileTo2007
Any ideas would be appreciated.

Hi,
This is the forum to discuss questions and feedback for Microsoft Excel, I'll move your question to the MSDN forum for Excel
http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
George Zhao
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs.

Similar Messages

  • How can I use Automator to extract specific Data from a text file?

    I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
    How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
    Example of File Contents:
    Link Time =
    DD/MMM/YYYY
    Random
    Text
    161 179
    bytes of CODE    memory (+                68 range fill )
    16 789
    bytes of DATA    memory (+    59 absolute )
    1 875
    bytes of XDATA   memory (+ 1 855 absolute )
    90 783
    bytes of FARCODE memory
    What I would like to have as a final file:
    EXCEL COLUMN1
    Column 2
    Column3
    Column4
    Column5
    Column6
    MM/DD/YYYY
    filename1
    161179
    16789
    1875
    90783
    MM/DD/YYYY
    filename2
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    MM/DD/YYYY
    filename3
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • How can I use apps that I have purchased from Apps Store for Mac on my iPad2?

    how can I use apps that I have purchased from Apps Store for Mac on my iPad2?

    Thanks, varjak, it is too easy to fall into use of jargon assuming everyone understands what it means.
    One additional point in all of this, not all "iDevice" apps run on every "iDevice".  Some are customized for a specific device, or class of devices such as the iPod/iPhone with their smaller screen.  Others for just the iPads for their larger screens.  So the user needs to be sure they are getting an app that will work on their specific device.
    And to Phoneboone, you do need to purchase the app again if it is for a different class of equipment.  When you are looking at apps such as iWorks for the Mac and iWorks components for the iPad, the iPad versions are very inexpensive.  Pages is only $10 (US) which is really cheap for such a good word processor that reads and saves in the MS Word format.
    Anyway, search for what you need and just enjoy the convenience of so many options for apps.

  • HT5616 How can I use my apple ID to buy from different app stores (different countries)?

    How can I use my apple ID to buy from different app stores (different countries)?

    You can only use a country's store if you are in that country and have a billing address in that country on your account - are you in the country that you want to buy content from ? If you are then you can update the billing address on your account to be your address there (if using a credit card then that will need to have been issued by a bank in that country) via the Store > View Account menu option on your computer's iTunes.

  • My gf is one of those ppl with the horrible habbit of downloading anything and everything the internet tells her she needs how can i use FF to better protect her from the various virus she downloads on a regular basise

    as i write this i have just restored my gf's computer back to default factory setings and cleaned the HD she has a horrible habbit of downloading anything and everything something tells her to download it her most recent actions caused her to dl a virus along with a prog called "flv tube" ive never heard of it but in less then 5 mins on google i found it to be common with viruses how can i use FF to prevent and or stop her from downloading all this crap so im not always having to fix it for her

    Public Fox: https://addons.mozilla.org/firefox/addon/3911
    Be aware that an extension can easily be bypassed by starting Firefox in [[Safe mode]] or by using the portable Firefox version.

  • How can I use (transfer image or music) Bluetooth from my iPhone?, How can I use (transfer image or music) Bluetooth from my iPhone?

    Hi
    How can I use bluetooth of my iPhone?

    You cannot transfer music/images via bluetooth.  This has never been a feature of the iphone.
    Bluetooth is supported for:
    Stereo headsets/speakers, handsfree telephone devices, some keyboards, some apps from the app store, and internet tethering if provided by the carrirer

  • How can I use VBA in Outlook to "Save as pdf"???

    I want to create a macro in Outlook 2010 that will create a pdf file of the open email... using the "Save as pdf" command. How can this be done?
    I have looked all over the internet, and have not found a simple answer...
    Please can someone help me.

    There is only one documented and supported way to create PDF files from a
    VBA application, and that is via the Adobe PDF printer. You can set the
    output filename programatically as I described. Anything else that you may
    be able to discover in the type library is not meant for you to use. Adobe
    can (and has in the past) changed these internal interfaces without notice,
    so even if you could make something work, it would be a dangerous way of
    implementing things. Any small update to your Acrobat installation would
    put your software at risk.
    I understand that sometimes this is frustrating because we think that
    "there must be an easy way to do xyz"... Try to come up with a different
    way of doing things.
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com
    On Tue, Mar 12, 2013 at 4:54 AM, Test Screen Name

  • HT1178 How can I use Time Capsule to move music from one computer to another?

    I want to move all the music I have on my old laptop (macbook) to my new macbook pro. How can I do this? Easy, simple, steps would be greatly appreciated!

    Are you moving the itunes library?? That is entirely different to moving just music.
    Apple have specific instructions for moving libraries..
    And there is no need to use the TC.. other than as a switch and router.. share the folder in one Mac to copy to.
    http://support.apple.com/kb/HT1449

  • How can I use a PCMCIA RS-485 card from a LabView .exe?

    Hi all,
    We are going to be taking a LabView application and compiling it into an executable (.exe) for use by someone who does not have LabView.  This program requires use of either a National Instruments PCMCIA RS-485 card or possibly a USB RS-485 card.  The question is this - how do I use the card since we will not be able to run the MAXX software ahead of time to "install" the card?
    Thanks,
    Jason

    Hi Jason,
    On this deployment machine, you will need to have NI-Serial, NI-VISA, and the LabVIEW Run-time Engine. The version of the LabVIEW run-time engine will need to be the same version as the application was developed on. This can be downloaded from the Drivers and Update page or an installer can be created to install your application as well as the necessary run-time engine.
    If your application has RS-485 communication, you will need to install both NI-Serial and NI-VISA on this deployment machine. NI-Serial is the driver for the NI PCMCIA-485 or NI USB-485. The NI-Serial driver allows the devices to be properly configured and recognized in Windows. NI-VISA gives you the programming capability in LabVIEW. You can add both the VISA run-time engine and NI-Serial to your installer. You will need both of these drivers with the NI Serial hardware.
    You will have to run through the "Found New Hardware" Wizard when you install the hardware initially on this deployment computer, but setting up the baud rates and communication configuration should be done in your application as normal.
    I hope this helps!
    Regards,
    Missy S.
    Calibration Engineer
    National Instruments

  • How can I use a Lookup task to lookup from my SQL Result set and have a join

    So in my Control Flow, I have an Execute SQL Task which gets my Table result set. I then have a Foreach Loop Container that iterates through the result set and a Data Flow. The first task in the Data Flow is an OLE DB Source SQL Command that retrieves data
    columns associated with my result set. I then do a Derived Column so I can SUBSTRING from one of my data columns and now I want to perform a Lookup to my Application Database.
    How do I code my Lookup task to utilize my SQL Result set variable and match on it? I cannot use the GUI for the Lookup task as my Lookup has to have some JOINS in it.
    Thanks for your review and am hopeful for a reply.

    Can you expand on that? I'm sorry but I am new and a novice to the SSIS world and I want to do this as best I can and as efficiently as I can. Are you saying that Rajen's way suggested above is the way to go?
    A little background....external data from a 3rd party client. I'v staged that external data to a SQL Server staging table. I have to try and match that data up to our database using SSN, DOB, and Gender...and if I can't match that way then I have to try
    and match by Name. I need to make sure that there is only one and only one account for that match. If I cannot match and match one and only one, then I'll create rows on a DataAnomaly Table. If I do match, then I have to check and make sure that there is only
    one and only one Member span for that match. Similarly handle the data anomaly and then check and make sure there is a "Diabetes" claim and similarly handle the DataAnomaly accordingly.
    That's where I'm at. Sooooo are you saying to use Rajen's suggestion? I don't think I can do that because I need multiple SQL tasks and I cannot connect multiple OLE DB Source tasks.
    Any help and suggestions are greatly appreciated.
    Thanks.

  • How can i  use  this  java program to access from  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }here i need to generate the strings like 'enter value1' and respective text boxes dynamically . i should use this java program as business logic and a jsp page for view.
    following given is my text file input.eqn
    input:enter value1:arg1
    input:enter value2:arg2
    input:enter value3:arg3
    constant:enter constant1:arg4
    constant:enter constant2:arg5
    equation:enter equation:(arg1+arg2)*(arg3+arg4)*arg5
    result:

    Why do you double post ? http://forum.java.sun.com/thread.jspa?threadID=646988&tstart=0
    Why dint that answer satisfy you ? And why dint you say so in that thread rather than posting the same question again ?
    ram.

  • How can i know if move successfully my PF from Exchange 2003 to Exchange 2010

    Hello I need from your help, recently I install exchange 2010 in mi Exchange 2003 orgamnization and follow the next article
    http://technet.microsoft.com/en-us/library/gg576862(v=exchg.141).aspx but i don't know if the Public Folders migrating correctly I first move them through the powershell scrip
    MoveAllReplicas.ps1 but aparently nohtimg happend after that y use the option MoveAllReplicas using right click over the public folder store, and take a lot of time but aparently the allreplicas were moved, but really in other side, Exchange 2010 i can't see
    all the System Public Folders it missing SYSTEM CONFIGURATION and HIERARCHY using the public folder viewer from Exchange 2010, so I am not sure about that, so I shutdown the Exchange Server 2003 during one day until now, and all works fine, that means all
    public folders have been moved succeesfully?
    Thanks in advance for your help
    Felxs
    Felx

    Hi,
    To verify that public folder replication is successful, you can check the item count of public folders between replicas. If the item count matches, then this replication succeed.
    You can use the Get-PublicFolderStatistics cmdlet to get item count of public folders.
    Here is an related blog for your reference.
    Comparing public folder item counts
    http://blogs.technet.com/b/exchange/archive/2013/05/28/comparing-public-folder-item-counts.aspx
    Hope this helps.
    Best regards,
    Belinda
    Belinda Ma
    TechNet Community Support

  • How can i use a song as a ring tone from a cd i have loaded on the 4s

    How can i use a song as a ringtone from  a cd i have loaded on my iphone 4s

    The weird thing is, when u make your own ringtones, they sound terrible when set as a ringtone (really tiny and generally awful), but when u set them as a text tone or any other alert they sound great (like they do when u play them through the music app).
    Is this just a bug with iOS5 or have previous models also done this?

  • How can i use chinese in iphone

    how can i use chinese in phone

    Settings>General>International>Language>Keyboards>Region Format.

  • How can I use pdf pack to convert cubase documents  (music scores)  into pdfs? I am looking for the former possibility to install acrobat like a printer but i don't have this option with "pdf pack". Can you help?

    How can I use pdf pack to convert cubase documents  (music scores)  into pdfs? I am looking for the former possibility to install acrobat like a printer but i don't have this option with "pdf pack". Can you help?

    Hi mariab,
    What format are those music scores (I'm not familiar with cubase documents). But, it may be that Adobe PDF Pack doesn't support that format. In that case, Acrobat is the way to go. You can then print your files to PDF as you'd like. You're welcome to try Acrobat for free for 30 days to see whether it's going to work for you. If you decide it is, and you'd like to use it going forward, you could convert your PDF Pack subscription into an Acrobat subscription.
    Best,
    Sara

Maybe you are looking for

  • How to change default close maximize and minimize button in mac?

    How can I change default close, maximize and minimize button in mac?

  • 5200:Error executing query: null

    I am getting the error message 5200:Error executing query: null when trying to run a report that was perfectly fine a week ago. I searched on the internet and running the utility DeletePOV.cmd seems to resolve this issue for a lot of people. My issue

  • Using iChat AV at Panera?!

    My girlfriend and I bought "his-and-hers" MacBooks. Sitting side-by-side at our local Panera, we both launched iChat AV. We tried inviting each other to video conferences, but each of us got an error message saying that we didn't respond (mine said t

  • Message contact

    hi,im using iphone 4,now i would delete an usesful contact number in my message,that i cant.. i delete in my contact but appear in my message text,how could i do it...

  • How do I change a layer selection color from black to a color?

    Somehow I've turned off the color selection so that I don't have a color when I select a part of a drawing on a layer. The drawing area stays black whether I have selected it or not and I don't know how to turn back on the color. Could someone tell m