Skip to main content

Posts

Showing posts from June, 2019

Excel Macro to Open an existing Excel Workbook एक्सेल मैक्रो मौजूदा एक्सेल वर्कबुक खोलने के लिए

👍  Refer the following Excel VBA code to open an existing excel workbook which is saved at a given path.  To run the below code, do not forget to change the file path which I have provided. मौजूदा एक्सेल कार्यपुस्तिका को खोलने के लिए निम्नलिखित एक्सेल VBA कोड का संदर्भ लें जो किसी दिए गए पथ पर सहेजा गया है। नीचे दिए गए कोड को चलाने के लिए, मेरे द्वारा प्रदान की गई फ़ाइल पथ को बदलना न भूलें। Sub openExcelWorkbook ( ) Dim wb As Workbook Dim fPath As String fPath = "D : \abc\myfile.xlsx" Set wb = workbooks. Open ( Filename : = fPath ) 'given workbook is opened and it is referred by ' the variable wb of type workbook ' now you can do all the operations on wb which ' you want to do on this workbook 'For Example to close this workbook wb. Close End Sub

Excel Macro to Create a New Excel Workbook File एक्सेल मैक्रो एक नई एक्सेल वर्कबुक फाइल बनाने के लिए

👍  Use the following Excel VBA code to create a new Excel Workbook and save it as a given path as shown in the below code. एक नई एक्सेल वर्कबुक बनाने के लिए निम्नलिखित एक्सेल वीबीए कोड का उपयोग करें और इसे दिए गए मार्ग के रूप में सहेजें जैसा कि नीचे दिए गए कोड में दिखाया गया है। Sub CreateNewExcelWorkbook ( ) Dim wb As Workbook Set wb = Workbooks.Add ' now if you want to save this new workbook ' save it by providing the full name of the file wb.SaveAs "D : \abc\temp.xlsx" End Sub