Printing from Access VBA in Urdu Language

I have some data in table in Urdu language, I want to print it by putting on LPT1 but when I get data in VBA it converts it into ???????. Urdu language pack is already installed and it's working in all other applications. How can I prevent my data to change
into ?????? while getting it in Access VBA.

I assume that "to get the data from the table into VBA" means that you assign a value from a recordset or from a form field that is bount to a recordset to a variable, e.g.,
Dim rs As DAO.Recordset
Dim UrduString As String
Set rs = CurrentDB.OpenRecordset("UrduTable")
UrduString = rs!SomeField
In this assignment, the data in UrduString is not modified in any way, it is completely identical to the data in the table.
However, if you look at it in the VBA Editor, e.g. with
   Debug.Print UrduString
it displays as ???????. This is because of a limitation in the VBA Editor: It cannot properly *display* the contents of the Urdu string, allthough VBA correctly *stores* this content.
What do you mean by "putting the data on LPT1"? Something like
Open "LPT1:" For Binary Access Write As #1
Put #1, , UrduText
You will need to output the text in binary format. If you try to write in text format, it will indeed get transformed from Unicode to ANSI, thus producing the ????.
Matthias Kläy, Kläy Computing AG

Similar Messages

  • Printing to PDF Writer from Access VBA

    I have the printer properties for the Adobe PDF Writer set to use a default output folder on my desktop, and to not prompt for a filename.  I have a loop in MS Access VBA that sends about 3000 individual reports to the PDF Writer, one after the next after the next.  Each one has a different filename and eventually it prints all my reports.  Recently I have been getting an error from MS Access that says "Error 2212.  Could not print your report."  It stops the print run and I have to reset and pick up where it left off.  Sometimes it prints 50 sometimes it prints 2500 before it hits that error.  Sometimes it takes 5 or  tries to get the job completed.  Does anyone have any suggestions as to what may be going on?
    Access 2003 SP3 on Windows XP Pro SP3, each upgraded with all MS Windows/Office updates.  Adobe Acrobat 7, upgraded to 8, upgraded incrimentally to 8.14
    Thank you for any advice. . .
    ~gabriel

    You might also check the two developer forums
    Acrobat Scripting Forum http://forums.adobe.com/community/acrobat/acrobat_scripting
    Acrobat SDK Developer Forum http://forums.adobe.com/community/acrobat/acrobat_scripting

  • Creating bookmarks from access(VBA)

    Hi all,
    Im creating a number of bookmarks from access 2010 via VBA. And it works fine except that the acrobat.exe file still remains in process permanently. Ive found that it is this line bookmarkList = bookmarkRoot.children which causes the acrobat.exe to stay in memory. I hope im missing something fundamental here.If i remove that line, acrobat.exe closes correctly and disappears from the proccess. Ive tried bookmarklist = null(long shot) and Set bookmarkList = Nothing without success. Im hoping someone can guide me in the right direction here Im using acrobat pro X. Can anyone replicate this issue or better yet know how to fix it?
    dim bookmarkList as variant
    dim objAdobe As Object
    dim avDoc As Object
    dim PDDoc As Object
    dim PDPage As Object
    dim JSO As Object
    dimBookMarkRoot As Object
    Set objAdobe = CreateObject("AcroExch.App")
    Set PDDoc = CreateObject("AcroExch.pdDoc")
    Set avDoc = CreateObject("AcroExch.avDoc")
    pdDoc.open("C:\xxxxx \test.pdf") 'it has one page in it
    Set JSO = PDDoc.GetJSObject
    Set BookMarkRoot = JSO.BookMarkRoot
    BookMarkRoot.createChild "TEST", "", 0
    bookmarkList = bookmarkRoot.children'causes acrobat.exe to stay open in task manager(processes), have tried set bookmarkList= Nothing and bookmarkList= null
    pdDoc.save(1,'C:\xxxx\test2.pdf')
    Set JSO = Nothing
    Set PDPage = Nothing
    Set avDoc = Nothing
    Set BookMarkRoot = Nothing
    PDDoc.Close
    objAdobe.CloseAllDocs
    objAdobe.Exit
    Set PDDoc = Nothing
    Set objAdobe = Nothing
    Regards,
    Ingman

    Hi,
    Thank you for your reply. Im not sure if i understand you correctly. if i want to loop a level of bookmarks. should i not use the .children? just to clarify, above code is just an exemple ive stripped in order to make replication of My case easier. I create about 500 bookmarks in a hierarcy structure depending on the data. So after i create a bookmark i retrieve it from the .children since i need it to create new children. Are There Any other way that i have missed doing this?

  • How may I print a pdf doc from access vba code

    I have a directory of files and I want to send these files to the printer in a specific order (right-clicking in the explorer seems to give an unpredictable order).
    I am using the sdk and know how to find the files in the directory, but I can't find any print-method???
    Has anybody any code?

    Thank you!
    Yes I have downloaded the SDK and read the documentation, but obviously not good enough (there are a lot of doc. files). Sorry for that!
    But I have got into a problem since one year ago....
    Looking in the references in Access (2007), I see that the Adobe Acrobat 8.0 Type Libray (Acrobat.tlb) is pointing to my program directory, not to the c:\Program files\Adobe\Acrobat 8.0\Acrobat where the Acrobat.tlb is placed. My program directory does NOT contain this Acrobat.tlb!!!
    When I remove and reconnects to the proper directory, it automatically goes back to point to my program directory (where the Access program is).
    As a result (?) my Access program stops working when I try to open a pdf-document.
    Any ideas what has happended / what to do?

  • Now really can't print from Officejet Pro 8600 Plus

    This is my second attempt to get help.  The first help made it worse.  I had been unable to print from my wireless printer from my MacBook Pro, iPad, or iPhone.  After about 20 hours I got it to print from a cable (it sees my network but none of my devices can see it).  So I posted here asking for help and was told to uninstall the software, repair disc permissions, and reinstall the software.  But when I downloaded the new software my computer would not install it because it says it is for Mac System 10.7 or less and I have 10.10.  So now I can't print anything at all.  I need this for work.  Please help me fix it for real.  I can't take this any more.  
    This question was solved.
    View Solution.

    Thanks for providing that information JeanneS1. I have provided some more information that should help us resolve this issue. I know you have already spent a lot of time on this, but I am willing to continue trying to get this working properly over the wireless network. 
    Power cycle the router, restart the Mac and the printer.
    I would print off a Configuration Page to see if the printer still has a valid IP address.
    Try to access the printer's Embedded Web Server. If it connects then the printer is still on the network.
    If you don't have a valid IP address, once more run the Wireless Setup Wizard on the printer.
    Setup a Static IP address for the printer, this way the router will always assign the same IP address to the printer. Which should stop the disconnection.
    Here is a document on this issue. But for now just follow Solution two: Assign the printer an automatic static IP address under Mac. Printer Does Not Maintain Wireless Connection.
    Click the Apple menu and then click System Preferences. Click Printers & Scanners, highlight the printer name on the left side and delete the old driver, click the + sign to add the driver, you might have to click the drop down to select the printer's name to add it in.  (Officejet Pro 8600 Plus)
    Here is a screen shot.
    Then test the printer.
    You might need to update the printer's firmware if you haven't already.
    How far is the printer from the router?
    Here a few causes of why the printer can lose the wireless connection:
    The recommended distance between the printer and the router is 1.0 meter to 1.5 meters (3 ft to 5 ft).
    A nearby device that emits radio signals (such as a microwave or cordless telephone) might interfere with the wireless connection.
    A virtual private network (VPN) prevents the printer from accessing the computer and wireless network.
    The network connection is no longer active, or has low signal strength.
    The printer goes into sleep mode or standby mode.
    A firewall prevents the printer from accessing the computer and wireless network.
    What kind of router are you using?
    What kind of security are you using? (WPA2/WPA, WPA Personal, WEP)
    What band is the router set to? (2ghz or 5ghz)
    I believe by changing these settings on the router will help with this issue if it continues. You might need to contact the router company to make those changes.
    Make sure that on your wireless modem, the channels for 2.4Ghz and 5Ghz are fixed and are not set to automatic !!
    Select channel 6 for 2.4Ghz and channel 36 for 5Ghz frequency.
    Hope this helps get you up and running again.
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Printing from websites accessed through Firefox is unitelligible - just symbols, whereas fine with Safari.

    For the last week or so, whenever I try to print from a website accessed by Firefox (either to pdf or printer) the resulting pages(s) are completely unitellibible -- they look like a kind of code. I have McAfee- SitAdvisor is disabeled and Firefox has full access through the Firewall. My Windows FIrewall is turned off.
    When I use Safari for the same operations, everything prints fine.
    Please advise.
    Thanks

    I also have this problem. I believe it is caused by being connected through a proxy which is adding a second compression to the data. (I think IF uses gzip compression already).
    Added details:
    * Opera also works.
    * I can view the IF admin section on FF
    * I can view the forum if I go through a web proxy.

  • Can I Modify .MDB VBA From Access 2010?

    Hello:
    Currently, I am using Access 2010 and 2013.  One of my clients is still using an mdb file created by Access 2003.  They don't want me to upgrade to .accdb, but want me to modify the VBA code.
    Prior to today, I had a version of Access 2003, but that is no longer available to me.  Can I successfully make VBA changes to an Access 2003 .mdb file from Access 2010 with the same reliability I could expect if making them from native Access 2003...
    and still leave the file as an .mdb?
    Thanks,
    Rich Locus, Logicwurks, LLC
    http://www.logicwurks.com

    In general: yes. The only gotcha is that your version of Access may update the references to non-standard code libraries. The client will then have to remove those references and set the appropriate ones for their system.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Printing a Crystal Report XI in Business Objects from Access (VB)

    Post Author: karene
    CA Forum: Other
    I have a report that is stored in the BusinessObjects (and I'm new to this system).  I can open it from Access using VB, by running iexplore.exe and giving it the correct URL:
    stAppName = "C:\Program Files\Internet Explorer\iexplore.exe " & GetReclassificationReportURL() & _        "&lsS@type=site&lsS@id=" & SiteId    Call Shell(stAppName, 1)
    where the GetReclassificationReportURL returns something like https://xidesign.ourdomain/businessobjects/enterprise115/InfoView/scripts/OpenDocument.aspx?iDocID=24321825
    This opens Crystal, and they can view or print the report.  However, when they were using the corresponding Access report, it would print for them directly.  They could press a print button, and it would come out on their default printer.  Can I do that using Crystal?  How?  (I'm using Access 2003, and VB 6.3)
    Thank you for any assistance you can provide.
    -karene

    Post Author: RamcoSystems
    CA Forum: Deployment
    Hai,
        Installation of BOXI does not not include Crystal Reports as a part of it?If yes, then does the crystalreportviewer ship along with BOXI?

  • Printing From MS Access Report Looks Different on Different Machines

    Hello all. I am creating a pdf report from Access. I am on a very large government network and several users are creating the same report with exactly the same data. Each user has the same version of Acrobat Pro, the same version of Access, the same operating system. However, for some users, the reports are too wide, or some vertical grid lines are not lining up correctly, and for others, it looks fine. If I fix the report for some people, it will mess it up for others. What would cause this behavior? One person in the Access forum suggested that it may have something to do with which network printers we have installed on our machines. I have 4 printers installed on my machine including a color printer, but other users may have other printers. Any ideas? I am using Adobe Acrobat X Pro and Access 2010.

    Is everyone using Access 2010? The variations in Access may also be an issue. To check the layout in Access, go to the print menu and select the Adobe PDF printer and then go back through the Access report (or print preview). That is how it should look as it is created to a PDF.
    Other aspects that might affect the result could be the job settings selected for the Adobe PDF printer. lines tend to have problems if a low resolution is used in some cases. Try a Print or Press settings to be sure to get high quality graphics. You might also check the Print Quality setting in the printer properties (Layout>Advanced). I use 300dpi to get around some issues of a line being defined as a pixel and not showing on screen when using the default 1200 dpi. [these settings may vary with Acrobat version -- this machine uses AA 9]
    So checking Acrobat versions, OS, Access version, and the various settings may be required to get consistency. I have a tendancy to set the Adobe PDF printer as my default printer and then the results for my word processor are consistent between machines.

  • I have a new Macbook pro and need to run some Windows software, it appears "Parallel" should work well from what I've have read. Will I have any issues or problems accessing and printing from various printers on my Windows 7 network within Parallel?

    I have a new Macbook pro and need to run some Windows software, it appears "Parallel" should work well from what I've have read. Will I have any issues or problems accessing and printing from various printers on my Windows 7 network within Parallel? Is Parallel in fact the best way to go?

    First, back up all data immediately, as your boot drive might be failing.
    There are a few other possible causes of generalized slow performance that you can rule out easily.
    Reset the System Management Controller.
    If you have many image or video files on the Desktop with preview icons, move them to another folder.
    If applicable, uncheck all boxes in the iCloud preference pane.
    Disconnect all non-essential wired peripherals and remove aftermarket expansion cards, if any.
    Check your keychains in Keychain Access for excessively duplicated items.
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

  • TS3999 How do I print from i cloud? I can access and add appointments but cannot print. Only a blank page shows up.

    How do I print from i cloud? I can access and add appointments but cannot print. Only a blank page shows up.

    Select the day. then look on the bottom left where you will see the word, TODAY, select it then select print frame.

  • Access Printer from both desktop and laptop

    Can i install a  HP Photosmart 5510 on my desktop using the usb connection, and access the same printer from my laptop using wifi?  Desktop is XP Pro and Laptop isn 64 bit Windows 7.

    You can, but why?  The 5510 is a network-able printer.  Connect it wirelessly to your wireless router and be able to print AND scan from both computers.  
    Sharing via USB will only sharing printing, not scanning.  It is hard to set up and the host computer can never go to sleep!
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Switched to external monitor lost access to Diagnostic Policy, Basic Filtering Engine, cannot print from interenet explorer

    Laptop running windows 7
    I switched to an external monitor (broke the LCD) and lost all sorts of things
    1) Diagnostic Policy was not running, and could not be started via services.msc - I received "Access Denied" Error.
    Fixed with
    net localgroup Administrators /add networkservice
    net localgroup Administrators /add localservice
    2) Base Filtering Engine was not running, and could not be started via services.msc - I received "Access Denied" Error.
    Still not running - tried all the usual suspects
    a) virus scan
    b) SFC
    c) registry entry looks fine
    d) adding "Everyone" with full access to the ControlSet/services/BFE registry key
    3) Cannot print from Internet Explorer
    There are probably other issues .. I suspect there is a common underlying problem, but have no idea of where to look
    Thanks
    Jonathan
    JonW

    I dropped the unit on the floor on 6/11 around 1PM, and then tried to turn it on.    I hooked the laptop up to an external monitor at 9:34PM. 
    This is a trimmed down subset of the log (I do not see any way to attach files to this post)
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Dhcp-Client        1004      
    Service State Event
    Error      6/11/2014 9:35:13 PM   
    Dhcp-Client        50038   
    Service State Event
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7023       None
    Error      6/11/2014 9:35:13 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    Dhcp-Client        1004      
    Service State Event
    Error      6/11/2014 9:35:13 PM   
    Dhcp-Client        50038   
    Service State Event
    Error      6/11/2014 9:35:12 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:35:13 PM   
    DistributedCOM              
    10005    None
    Error      6/11/2014 9:34:52 PM   
    Service Control Manager             
    7024       None
    Error      6/11/2014 9:34:52 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:34:49 PM   
    Eventlog             
    1101       Event processing
    Error      6/11/2014 9:34:47 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:34:45 PM   
    Service Control Manager             
    7023       None
    Error      6/11/2014 9:34:45 PM   
    Service Control Manager             
    7023       None
    Error      6/11/2014 9:34:41 PM   
    Service Control Manager             
    7001       None
    Error      6/11/2014 9:34:41 PM   
    Service Control Manager             
    7023       None
    Error      6/11/2014 9:34:41 PM   
    VSS        8193      
    None
    Error      6/11/2014 9:34:40 PM   
    Service Control Manager             
    7023       None
    Error      6/11/2014 9:34:40 PM   
    Dhcp-Client        1004      
    Service State Event
    Error      6/11/2014 9:34:40 PM   
    Dhcp-Client        50038   
    Service State Event
    Error      6/11/2014 9:34:38 PM   
    Shell-AuthUI      5007      
    None
    Critical   6/11/2014 9:34:27 PM   
    Kernel-Power    41          
    (63)
    Error      6/11/2014 9:34:37 PM   
    EventLog            
    6008       None
    Critical   6/11/2014 1:15:48 PM   
    Kernel-Power    41          
    (63)
    Error      6/11/2014 1:16:06 PM   
    EventLog            
    6008       None
    Error      6/11/2014 1:07:22 PM   
    WMI      10          
    None
    Error      6/11/2014 1:07:14 PM   
    DistributedCOM              
    10016    None
    Error      6/11/2014 1:05:59 PM   
    Eventlog             
    1101       Event processing
    Error      6/11/2014 1:05:58 PM   
    Shell-AuthUI      5007      
    None
    Critical   6/11/2014 1:05:38 PM   
    Kernel-Power    41          
    (63)
    Error      6/11/2014 1:05:58 PM   
    EventLog            
    6008       None
    Error      6/11/2014 1:02:17 PM   
    Diagnostics-Performance            
    300         Standby Performance Monitoring
    Error      6/11/2014 1:02:15 PM   
    WLAN-AutoConfig          
    8002       AcmConnection
    Error      6/11/2014 1:02:15 PM   
    WLAN-AutoConfig          
    11002    MsmAssociation
    JonW

  • OfficeJet 8600 Pro Ethernet networked. Accessing SD card in printer from server

    I am attempting to access the SD card on the printer from the server.  The printer is hardwired ethernet and I have the printer shared and a shared folder that I want to export the pictures to from the SD card.

    Hi,
    Please use the following instructions:
       http://h10025.www1.hp.com/ewfrf/wc/document?lc=en&dlc=en&cc=us&docname=c00149194
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • To export query from Access to Excel in Read/Write mode in VBA

    Below is the code which exports the query named 'LatestSNR' from Access to Excel;
    Public Sub Expdata()
    Dim rst As DAO.Recordset
    Dim Apxl As Object
    Dim xlWBk, xlWSh As Object
    Dim PathEx As String
    Dim fld As DAO.Field
    PathEx = Forms("Export").Text14 'path comes from the directory given in form
    Set Apxl = CreateObject("Excel.Application")
    Set rst = CurrentDb.OpenRecordset("LatestSNR")
    Set xlWBk = Apxl.Workbooks.Open(PathEx)
    'xlWBk.ChangeFileAccess xlReadWrite
    Set xlWBk = Workbook("PathEx")
    Apxl.Visible = True
    Set xlWSh = xlWBk.Worksheets("Metadatasheet")
    xlWSh.Activate
    xlWSh.Range("A2").Select
    For Each fld In rst.Fields
    Apxl.ActiveCell = fld.Name
    Apxl.ActiveCell.Offset(0, 1).Select
    Next
    rst.MoveFirst
    xlWSh.Range("A2").CopyFromRecordset rst
    xlWSh.Range("1:1").Select
    ' selects all of the cells
    Apxl.ActiveSheet.Cells.Select
    ' selects the first cell to unselect all cells
    xlWSh.Range("A2").Select
    rst.Close
    Set rst = Nothing
    ' Quit excel
    Apxl.Quit
    End Sub
    After the execution of code, the query is transferred to excel sheet and is viewed in 'Read only' mode. If I try to save it, a copy of the excel file is produced. Can the Excel be opened in Read/Write mode ? so as to save the workbook and also to transfer
    the query to same workbook repeatedly.
    If in case the change of mode is not possible, then is there any alternative  method?

    Try this version:
    Public Sub Expdata()
    Dim rst As DAO.Recordset
    Dim Apxl As Object
    Dim xlWBk As Object, xlWSh As Object
    Dim PathEx As String
    Dim i As Long
    PathEx = Forms("Export").Text14 'path comes from the directory given in form
    Set Apxl = CreateObject("Excel.Application")
    Set xlWBk = Apxl.Workbooks.Open(PathEx)
    Set xlWSh = xlWBk.Worksheets("Metadatasheet")
    Set rst = CurrentDb.OpenRecordset("LatestSNR")
    For i = 1 To rst.Fields.Count
    xlWSh.Cells(1, i).Value = rst.Fields(i - 1).Name
    Next i
    rst.MoveFirst
    xlWSh.Range("A2").CopyFromRecordset rst
    xlWBk.Close SaveChanges:=True
    Apxl.Quit
    rst.Close
    Set rst = Nothing
    End Sub
    or else
    Public Sub Expdata()
    Dim PathEx As String
    PathEx = Forms("Export").Text14 'path comes from the directory given in form
    DoCmd.TransferSpreadsheet TransferType:=acExport, _
    SpreadsheetType:=acSpreadsheetTypeExcel12Xml, _
    TableName:="LatestSNR", _
    Filename:=PathEx, _
    HasFieldNames:=True, _
    Range:="Metadatasheet!"
    End Sub
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

Maybe you are looking for

  • Rmi client throws Connection Refused exception

    My Rmi client throws a Connection Refused exception when i try to run it on remote machine (in this case i run it on my virtualbox macine). The virtualbox machine network is in NAT mode (host machine ip should be 10.0.2.2). When rmi client starts get

  • Pass Marks for ABAP Certification

    Hi All, I am thinking to take ABAP certification test.Can anybody who has done certification recently, tell me what is the pass marks for it. I have got all other information, only this is left out. Thanks in advance.

  • Galaxy 5 verizon message customization

    1. when I am on the screen with all of my messages and I click the menu in the right-hand corner. There are random pictures in the background from my phone. Can I just select one or make it a solid color? 2.I have been able to change background and b

  • Resizing with the same center.

    Hi guys, I do you resize an object with the same center? It not difficult in Mac, just Control+May...but it is not the same combination for the PC. Thanks! Sebastiao

  • How do you turn down volume in bed?

    I regularly use my smartphone in bed to listen to music once the light it out. If a song comes on that I don't want to hit, I click the button on the top to go to next track.  Don't need to - in darkness - look at the screen opening my eyes to do tha